Creation
Details of the request:
- Base URL: {host}/ASMSAPI/
- URI: api/v9/ci
- Type: POST
-
Required headings:
- 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/ci
Parameters:**
| Name | Data type | Obligatory | Description |
|---|---|---|---|
| consoleType | String | Yes | Console ID - Specialist= 1 - Client = Administrator= 3 |
| TempItemId | Int | Yes | Temporary CI ID |
| Name | String | Yes | IC Name |
| categoryId | Int | Yes | IC Category |
| responsibleId | Int | Yes | Head of the CI |
| stateId | Int | Yes | State of the IC |
| projectId | Array | Yes | List with Project Identifiers |
| assetTag | String | No | CI Inventory Tag ID |
| acceptDate | Long | No | Date of company acceptance, Unix time in milliseconds |
| authorId | Int | No | Author or CI record identifier |
| barCode | String | No | Barcode |
| brandId | Int | No | CI Brand Identifier in Database/Catalog |
| checkinDate | Long | No | Registration day unix format |
| checkOutDate | Long | No | Date Company CI Was Deleted/Terminated |
| costCenterId | Int | No | IC Cost Center |
| depreciationMethod | Int | No | Depreciation method 1. Indicates that depreciation will be calculated using the straight-line method 2. Indicates that depreciation will be calculated using the method of the sum of the digits of the years |
| Description | String | No | Description |
| impactId | Int | No | Identification number of the impact of CI on the organization |
| installationDate | Long | No | CI Installation Date |
| manufacturerId | Int | No | IC Manufacturer Identifier in Database/Catalog |
| modelId | Int | No | IC Model ID Number |
| Price | Int | No | Price |
| providerId | Int | No | CI Provider Identifier in Database/Catalog |
| RFID | String | No | Radio frequency identifier for IC |
| reasonId | Int | No | Identifier of the reason why it is in the current state |
| reponsibleDate | Long | No | Date on which users became responsible for the CI Unix format |
| residualValue | Decimal | No | CI value to save from original price |
| riskId | Int | No | Risk Level, NoData = 0, Low = 1, Medium = 2, High = 3 |
| serial | String | No | CI Serial Identifier |
| size | Int | No | IQ size value, for example: 17 |
| type | Int | No | CI type identifier in an enumeration: - 21: Configuration Item - 48: Package |
| unit | Int | No | Unit of IQ measurements. |
| listAdditionalField | Array | Yes | List of additional fields |
| boolValue | Bool | No | Value if checkbox type |
| catalogId | Int | No | Catalog ID (if it’s a catalog type field) |
| dateValue | Long | No | Value if DateTime |
| Description | String | No | Descriptive Text of the Field |
| enable | Bool | No | True if the field is enabled for the current state (false otherwise) |
| fieldId | Int | No | Unique identifier in the data source |
| fieldType | Int | No | Describe the field type - None = 0, - ShortText = 1, - Datetime = 2, - List = 3, - LongText = 4, - CheckBox = 5, - Numeric = 6, - Recursive = 7, - List2 = 8, - Decimal = 9, - File = 10, - CatalogList = 11, - CatalogTree = 12, - Date = 13, - Time = 14, - Currency = 15, - Link = 16, - Position = 17, - MultiSelect 18 |
| floatValue | Decimal | No | Value if it is of decimal type |
| identifier | String | No | Identifier |
| inputStream | Stream | No | |
| intValue | Int | No | Value if it is integer type |
| itemId | Int | No | Parent Item ID. |
| mandatory | Bool | No | True if the field is required for the current state (false otherwise) |
| Name | String | No | Friendly name of the field |
| order | Int | No | Position in the field list |
| stringValue | String | No | Value if it is of the chain type |
| type | Int | No | Parent Type |
| visible | Bool | No | True if the field is visible for the current state (false otherwise) |
Body of the petition:
{
`"tempItemId" :-1,
`"consoleType":"Specialist",
`"assetTag": "promando IMagen 3",
`"authorId": 6919,
`"barCode": "promando IMagen",
`"brandId": 1050,
`"categoryId": 282,
`"checkinDate": 1620331200000,
`"costCenterId": 7,
`"depreciationMethod": 1,
`"description": "promando IMagen 3", "impactId": 1,
`"licenseNumber": "1",
`"manufacturerId": 193,
`"modelId": **null**,
`"name": "promando IMagen 3",
`"price": 0,
`"projects":[
`{
`"id":25
`}],
`"providerId": 193,
`"rfid": "RFID MABC02152018 - 1020R", "reponsibleDate": 1620331200000,
`"residualValue": **null**,
`"responsibleId": 6919,
`"serial": "MABC02152018 - 1020R",
`"size": "120",
`"stateId": 17,
`"type": 21,
`"unit": 5004,
`"checkOutDate": 1620331200000,
`"reasonId":**null**,
`"riskId": **null**,
`"acceptDate": 1620331200000,
`"listAdditionalField":
`[
`{
`"boolValue": **null**,
`"catalogId": 27,
`"dateValue": **null**,
`"description": "Department",
`"enable": **true**,
`"fieldId": 8273,
`"fieldType": 11,
`"floatValue": **null**,
`"identifier": "Department",
`"inputStream": **null**,
`"intValue": 7314,
`"itemId": **null**,
`"mandatory": **false**,
`"name": "Department",
`"order": 1,
`"projectId": 25,
`"stringValue": "Departamento 1", "type": 21,
`"visible": **true**
`}
`]
}
Answer:
As a response, a unique identifier of the CI created is obtained.
{
`"id": 3199,
`"result": true }
Error messages:
| Code | HTTP status | Error Message |
|---|---|---|
| 400 | BadRequest | InvalidTempItemId |
| 400 | BadRequest | InvalidTempItemId |
| 400 | BadRequest | InvalidStateId |
| 400 | BadRequest | ForIntegrationInterfaceIdIsRequired |
| 400 | BadRequest | StateBetweenCategoryAndCiDoesNot Exist |
| 400 | BadRequest | AdditionalFieldIsRequired |
| 400 | BadRequest | InvalidAdditionalFieldValue |
| 500 | InternalServerError | FailureAddCi |
{
`"exceptionMessage": "InvalidTempItemId",
`"message": "FailureAddCi",
`"operation": "AddCi",
`"serviceName": "CI"
}
{
`"exceptionMessage": "InvalidCategoryId",
`"message": "FailureAddCi",
`"operation": "AddCi",
`"serviceName": "CI"
}
{
`"exceptionMessage": "InvalidStateId",
`"message": "FailureAddCi",
`"operation": "AddCi",
`"serviceName": "CI"
}
{
`"exceptionMessage": "InvalidAdditionalFieldValue",
`"message": "FailureAddCi",
`"operation": "AddCi",
`"serviceName": "CI"
}
{
`"exceptionMessage": "ForIntegrationInterfaceIdIsRequired",
`"message": "FailureAddCi",
`"operation": "AddCi",
`"serviceName": "CI"
}
{
`"exceptionMessage": "StateBetweenCategoryAndCiDoesNotExist",
`"message": "FailureAddCi",
`"operation": "AddCi",
`"serviceName": "CI"
}
{
`"exceptionMessage": "Is null\r\nNombre del parámetro: request", "message": "FailureAddCi",
`"operation": "AddCi",
`"serviceName": "CI"
}