Petition Details
- Base URL: {host}/ASMSAPI/
- Uri: /api/v9/item/{id}/relation
- 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/item/{id}/relation
Parameters:
Name | Data type | Obligatory | Description |
---|---|---|---|
Id | Number | Yes | Case ID |
itemType | Text | Yes | Case Type |
relatedItemType | Text | Yes | Type of case to be related |
relatedItemId | Number | Yes | Identifier of the item to be related |
relationTypeId | Number | Yes | Identifier of the type of relationship; It is not mandatory for the type of relationship with articles. |
isSolution | Bool | No | Indicates whether an item is a solution; it is only mandatory for when an article is going to be related to the case |
typeIsReverse | Bool | No | It is only required for when the case types are:- Incidents - Problem - Change - Release - ServiceCall - Task - Maintenance |
Body of the petition
Ejemplo de relación de **incidente** con **artículo**. {
"itemType":"Incidents", "relatedItemType":"Article", "relatedItemId":1704, "isSolution":"true"
}
Ejemplo de cuerpo de la relación de ***Incidente*** con ***ServiceCall***: {
"itemType":"1",
"relatedItemType":"1",
"relatedItemId":3328,
"relationTypeId":8,
"typeIsReverse":"false"
}
Ejemplo de ítem con ***ci***
{
"itemType":"Incidents",
"relatedItemType":"Ci",
"relatedItemId":890,
"relationTypeId":65,
"typeIsReverse":"false" }
*Respuesta*
{
"result": true }
Response Parameters
Name | Data type | Description |
---|---|---|
result | Boolean | Indicates whether the operation was successful |
Error messages
Code | HTTP status | Error Message |
---|---|---|
400 | BadRequest | \r\nParameter Name: Id |
400 | BadRequest | InvalidItemType |
400 | BadRequest | InvalidRelatedItemId |
400 | BadRequest | InvalidRelatedItemType |
400 | BadRequest | InvalidRelationTypeId |
400 | BadRequest | InvalidProjectId |
400 | BadRequest | RequestNeedsSomeArguments |
403 | Forbidden | DoNotHavePermissionForThisAction |
500 | InternalServerError | FailureAddRelatedItem |