This operation creates a company. When you create it, it saves the attachments of both the case and its additional fields. After saving them, it deletes them from the temporary folder created for it.
Petition Details
- URL Base: {host}/ASMSAPI/
- URI:
/api/v9/company
- Guy:POST
-
Required Headers:
content-type: application/json
X-Authorization: Bearer {token}
URL Description
- {host}: It represents the domain of the environment in which the API is located.
- ASMSAPI/: Fixed API prefix.
- URI: Specific endpoint for the request.
⚐ EXAMPLE URL:
https://{host}/ASMSAPI/api/v9/company`
Parameters
Name | Data type | Obligatory | Description |
---|---|---|---|
Address1 | Text | No | First Address Field |
Address2 | Text | No | Second Address Field |
Address3 | Text | No | Third Address Field |
CityId | Number | No | City Identifier |
CityName | Text | No | Descriptive name of the city in which the company is located |
Contact | Text | No | Main contact of the company |
CountryId | Number | No | Identifier of the country where the company is located |
CountryName | Text | Yes | Friendly name of the country where the company is located |
Description | Text | No | Corrective actions when the case is marked as a major problem |
Text | No | Email of the company’s main contact | |
Ext | Text | No | Telephone extension of the company’s main contact |
FaxNumber | Text | No | Fax number of the company’s main contact |
Id | Number | No | Company Identifier |
isActive | Boolean | No | True if the company is active |
Location | Text | No | Location |
Mobil | Text | No | Mobile phone number of the company’s main contact |
Name | Text | Yes | Friendly name of the company |
Nit | Text | Yes | Company Tax Identification Number (NIT) |
Phone1 | Text | No | The company’s first phone |
Phone2 | Text | Yes | Second phone of the company |
Phone3 | Text | No | Third phone of the company |
StatusId | Number | Yes | State ID |
WebSiteURL | Text | No | Company website URL |
ProjectId | Number | Yes | Project ID |
ConsoleType | Number | Yes | The ID of the console that originates the request. Creation is only allowed from the Admin console (Value 3) |
RegisterType | Number | Yes | Type of record to create: Company = 38, Vendor = 58 |
Additional Fields (ListAdditionalField)
Name | Data type | Obligatory | Description |
---|---|---|---|
boolValue | Boolean | No | Boolean value of the additional field |
Description | Text | No | Description of the additional field |
enable | Boolean | Yes | Determines if the additional field is active |
order | Number | No | Order to be taken into account in the list of additional fields |
dateValue | Date | No | Date value of the additional field |
fieldId | Number | Yes | Additional field identifier |
fieldType | Number | Yes | Additional field type |
floatValue | Number | No | Decimal value of the additional field |
identifier | Text | No | Additional field identifier |
itemId | Stream | No | Byte value of the file for the additional field |
intValue | Number | No | Value in number for the additional field |
stringValue | Text | No | Text value of the additional field |
mandatory | Boolean | Yes | Whether the additional field is required or not |
Name | Text | Yes | Identifying name of the field |
visible | Boolean | Yes | The additional field must be visible or not on the forms |
type | Number | No | Type of object that represents the parent object |
Body of the petition
{
"Address1": "",
"Address2": "",
"Address3": "",
"CityId": 4,
"CityName": "Cali",
"Contact": "Servicio al cliente",
"CountryId": 2,
"CountryName": "Colombia",
"Description": "Empresa Guia",
"Email": "correo@empresaguia.com",
"Ext": "",
"FaxNumber": "",
"Id": "",
"isActive": true,
"Location": "",
"Mobil": "3111111111",
"Name": "Guia",
"Nit": "80090000909",
"Phone1": "6022002020",
"Phone2": "6023003030",
"Phone3": "",
"StatusId": "1",
"WebSiteURL": "",
"ProjectId": "25",
"ConsoleType": 3,
"RegisterType": 38,
"listAdditionalField": [
{
"boolValue": null,
"catalogId": null,
"dateValue": null,
"fieldId": 977,
"fieldType": 3,
"floatValue": null,
"identifier": "A001",
"inputStream": null,
"intValue": 118,
"stringValue": "Aranda Data Safe",
"mandatory": true
},
{
"boolValue": null,
"catalogId": null,
"dateValue": null,
"fieldId": 978,
"fieldType": 3,
"floatValue": null,
"inputStream": null,
"intValue": 146,
"mandatory": true,
"stringValue": "Aranda Virtual Support"
}
]
}
Answer
{
"id": 1
}
Response Parameters
Name | Data type | Description |
---|---|---|
Id | Number | Company Identifier |
Error Messages
Code | HTTP status | Error Message |
---|---|---|
400 | BadRequest | \r\nParameter Name: ConsoleType |
400 | BadRequest | \r\nParameter Name: Name |
400 | BadRequest | \r\nParameter Name: RegisterType |
400 | BadRequest | InvalidProjectId |
400 | BadRequest | StateIdIsEmpty |
400 | BadRequest | InvalidRegisterType |
400 | BadRequest | InvalidConsole |
403 | Forbidden | DoNotHavePermissionForThisAction |
500 | InternalServerError | FailureAddCompany |