Skip to main content
Version: 8.5.X

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

KeyDescription
AuthorizationBearer {access token obtained after authorization} or API Key
Content-Typeapplication/json

Body

KeyValue TypeDescription
destinationModelStringEnter 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 NamesStringName of the Asset or CI.
typeStringRelation 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
}