POST Relate a Request
URL: http://{{server-url}}/api/v1/request/{{request-Id}}/relation/bulk/create
Example: http://172.16.11.140/api/analytics/v1/request/2/relation/bulk/create
You can relate a request (Incident and Service Request) with the required Asset(s) or CI(s) by calling the above endpoint with the request ID. You have to pass the following key-values:
note
- You can establish relationships with multiple assets/CIs.
- However, archived or in-stage assets/CIs cannot be related.
- If any assets/CIs included in the API are unavailable, archived, or in stage, a partial relationship cannot be created.
Header
Key | Description |
---|---|
Authorization | Bearer {access token obtained after authorization} or API Key |
Content-Type | application/json |
Body
Key | Value Type | Description |
---|---|---|
destinationModel | String | Enter the module with which the request must be linked. Possible values are: - hardware= asset_hardware - cmdb=cmdb - Software= asset_software - nonit=asset_non_it |
destination Names | String | Name of the Asset or CI. |
type | String | Relation type. |
For example:
{
"destinationModel": "asset_hardware",
"destinationNames": [
"AST-2","AST-1"
],
"type": "related"
}
Example (Request & Response)
Request
curl --location 'http://172.16.11.140/api/analytics/v1/request/2/relation/bulk/create' \
--header 'Authorization: Apikey kZ90fnHR0j1WGkC%2F%40unQah0xXglX5HB%2B3bnPQdMhu41S4QK2SOGLjBIW%2BNnfmxejE%2FPcYlg%3D%3D' \
--header 'Content-Type: application/json' \
--data '{
"destinationModel": "asset_hardware",
"destinationNames": [
"AST-2","AST-1"
],
"type": "related"
}'
Response
{
"successIds": [
3,
4
],
"failerIds": null
}