Details of the request:
- URI: api/v8.6/ci/add
- Type: POST
-
Required headings:
- Content-Type: application/json
- Authorization: TOKEN
Parameters:
| Name | Guy | Obligatory | Description |
|---|---|---|---|
| Name | Text | Yes | Name of the IC. |
| ProjectId | Number | No | Project ID. |
| Guid | Text | No | External ID of the IC. This field is required only if the CI comes from an integration. |
| Type | Number | No | Type of IC. This field is required only if the CI comes from an integration. The options are: 1. Application 2. BusinessProcess 3. Catalog 4. Computer 5. Hub 6. Monitor 7. Phone 8. Printer 9. Router 10. Server 11. Service 12. SoftwareProduct 13. SystemSoftware 14. Tablet 15. Laptop |
| CategoryID | Number | No | Category id. If the Type field is sent in the request, this field should not be entered. |
| AuthorId | Number | No | Author’s ID. If it is not sent, the user token associated with the token used in the request is obtained. |
| Description | Text | No | Description of the Ci. |
| Building | Text | No | Name of the building. |
| City | Text | No | Name of city. |
| Company | Text | No | Company name. |
| CostCenter | Text | No | Cost center. |
| Country | Text | No | Name of the country. |
| CurrentStatus | Text | No | Name of the current state. |
| Department | Text | No | Name of the department, e.g. Development. |
| DepreciationMethod | Number | No | Id of the depreciation method (1: Straight line, 2: Sum of digits). |
| Floor | Text | No | Floor name, e.g. 25-Basement |
| GroupId | Number | No | ID of the IC grouping. |
| Impact | Number | No | Impact of IQ on the organization. |
| Manufacturer | Text | No | Name of the IC manufacturing company. |
| Model | Text | No | IC model. |
| DepartmentNumber | Text | No | Department number. |
| Price | Decimal | No | IC price. |
| CIProfile | Text | No | IC Profile. |
| ProgrammedStatus | Text | No | Name of the future state of the IC. |
| Provider | Text | No | Name of the IC provider company. |
| ResidualValue | Decimal | No | Value to be saved from the price of the IC. |
| Alias | Text | No | User responsible for the CI, can go in the following formats: Domain\User or Usiario@Dominio |
| Site | Text | No | Place. |
| Unit | Text | No | IC unit of measurement e.g.: inches |
| UsefulLife | Number | No | Years of useful life of the IC, for the calculation of depreciation |
| Brand | Text | No | Brand. |
| AdditionalField: | |||
| Type | Number | No | Additional field types are: 1.Text 2. Date 3. List 4. Long text 5. Check box 6. Number |
| Value | - | No | Information to be entered in the additional field, depends on the type of data that the additional field expects |
| Id | Number | No | Additional field ID |
Remarks:
- The CITotal field is not part of the parameters, as it is automatically calculated by the tool and is for internal use.
- The request is case sensitive, so you should leave the parameter names as they are in the parameter table.
- Keep in mind that, when creating correspondences, the category associated with the type must have configured states and transitions.
Body of the petition:
The request consists of a field-value json array with possible parameters as required. Example:
{
"Name": "Nombre del Ci",
"CategoryId": 19,
"GroupId": -1,
"CurrentStatus": "En uso",
"AuthorId": 3,
"ProgrammedStatus": "Estado Programado Prueba",
"Model": "GXP1200",
"Alias": " Usuario@Dominio ",
"AdditionalField": [
{
"Id": ###,
"Type": #,
"Value": "Valor"
}
]
}
Answer:
As a response, a unique identifier of the CI created is obtained.
Error messages:
| Code | HTTP status | Error Message |
|---|---|---|
| 400 | BadRequest | InvalidEventName |
| 400 | BadRequest | InvalidUserId |
| 400 | BadRequest | InvalidGuId |
| 400 | BadRequest | InvalidType |
| 400 | BadRequest | InvalidApplicationName |
| 400 | BadRequest | InvalidApplicationId |
| 400 | BadRequest | InvalidCiId |
| 400 | BadRequest | InvalidProjectIdByDefault |
| 400 | BadRequest | InvalidSubcategoryId |
| 400 | BadRequest | InvalidStateName |
| 400 | BadRequest | InvalidCompany |
| 400 | BadRequest | InvalidIdSettingGeneral |
| 400 | BadRequest | CatalogDescriptionIsRequired |
| 400 | BadRequest | InvalidCategoryId |
| 404 | NotFound | NotFoundStatesOfCMDB |
| 500 | InternalServerError | FailureAddCi |
| 500 | InternalServerError | FailureAddCiOrGetIdCi |