View additional fields eligible for dependencies
Petition Details
- Base URL: {host}/ASMSAPI/
- Uri: /api/v9/additionalsfields/dependents/list/{itemType}/{modelId}
- Type: GET
-
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.
- {itemType}: Type of case on which the additional fields are queried. Accepted values:
Incidents,ServiceCall,Change,Problem,Release. - {modelId}: Numerical identifier of the model for which the additional fields are to be consulted.
⚐ EXAMPLE URL:
https://{host}/ASMSAPI/api/v9/additionalsfields/dependents/list/ServiceCall/28
URL parameters
| Name | Data type | Obligatory | Description |
|---|---|---|---|
| itemType | Text | Yes | Type of case. Accepted values: Incidents, ServiceCall, Change, Problem, Release. |
| modelId | Number | Yes | Identifier of the model for which the additional fields are queried. |
Query Parameters
| Name | Data type | Obligatory | Description |
|---|---|---|---|
| onlySourceFields | Boolean | No | Indicates whether only the fields that can act as the parent field in a dependency (List, CatalogList, CheckBox) are returned. If omitted, the default value is true. If sent false, returns all additional fields in the model including ShortText, Numeric, Decimal, Currency, and others, allowing you to identify the available fields as a child field. |
Sample Request
Return only eligible fields as parent (onlySourceFields=true):
GET https://{host}/ASMSAPI/api/v9/additionalsfields/dependents/list/ServiceCall/28
Return all fields in the model (onlySourceFields=false):
GET https://{host}/ASMSAPI/api/v9/additionalsfields/dependents/list/ServiceCall/28?onlySourceFields=false
Answer
{
"content": [
{
"catalogId": null,
"fieldId": 543,
"fieldType": "List",
"hasDependencies": true,
"name": "País"
},
{
"catalogId": null,
"fieldId": 544,
"fieldType": "List",
"hasDependencies": false,
"name": "Ciudad"
},
{
"catalogId": 22,
"fieldId": 545,
"fieldType": "CatalogList",
"hasDependencies": false,
"name": "Sucursal"
},
{
"catalogId": null,
"fieldId": 552,
"fieldType": "CheckBox",
"hasDependencies": true,
"name": "¿Es sede principal?"
},
{
"catalogId": null,
"fieldId": 546,
"fieldType": "ShortText",
"hasDependencies": false,
"name": "Código Postal"
}
],
"totalItems": 5
}
Response Parameters
| Name | Data type | Description |
|---|---|---|
| totalItems | Number | Total additional fields found for the consulted model. |
| content | List | List of additional fields of the model. |
| catalogId | Number | Identifier of the catalog associated with the field. It only comes with value for CatalogList type fields. For List and CheckBox fields, the value is null. |
| fieldId | Number | Unique identifier of the additional field. This value is used as sourceFieldId or targetFieldId on the LOAD, RESOLVE, and DELETE endpoints. |
| fieldType | Text | Additional field data type. Possible values: List, CatalogList, CheckBox, ShortText, Numeric, Decimal, Currency, Date, among others. |
| hasDependencies | Boolean | Indicates whether the field has dependencies configured as the parent field. |
| Name | Text | Name of the additional field as configured in ASMS Administrator. |
Query parent field values
Once the fieldId of the eligible fields, it is necessary to query the available values of each parent field to obtain the triggerValueId required on the LOAD, RESOLVE, and DELETE endpoints.
For FieldType: “List” fields:
GET https://{host}/ASMSAPI/api/v9/additionalsfields/{fieldId}/type/3/values?dataType=0
For CatalogList fields (fieldType: “CatalogList”):
GET https://{host}/ASMSAPI/api/v9/additionalsfields/{fieldId}/type/11/values?catalogId={catalogId}
⚐ NOTE: For Type Fields CheckBox (False/True) it is not necessary. The
triggerValueIdfor this type of field is always 1 (true). There is no triggerValueId for the false value because dependencies on CheckBox fields are only configured for the true value.
Example of an answer for a List field:
{
"content": [
{
"catalogId": 0,
"description": null,
"fieldId": 543,
"hasChild": false,
"id": 494,
"key": null,
"name": "Colombia",
"order": 0,
"parentId": null,
"restrictLevel": false,
"status": 0
},
{
"catalogId": 0,
"description": null,
"fieldId": 543,
"hasChild": false,
"id": 495,
"key": null,
"name": "Argentina",
"order": 0,
"parentId": null,
"restrictLevel": false,
"status": 0
}
],
"totalItems": 2
}
Example of an answer for a CatalogList field:
{
"content": [
{
"catalogId": 22,
"description": null,
"fieldId": null,
"hasChild": false,
"id": 81,
"key": "Sede Norte(SN-001)",
"name": "Sede Norte(SN-001)",
"order": 1,
"parentId": null,
"restrictLevel": null,
"status": 1
},
{
"catalogId": 22,
"description": null,
"fieldId": null,
"hasChild": false,
"id": 82,
"key": "Sede Sur(SS-002)",
"name": "Sede Sur(SS-002)",
"order": 2,
"parentId": null,
"restrictLevel": null,
"status": 1
}
],
"totalItems": 2
}
Response Parameters
| Name | Data type | Description |
|---|---|---|
| Id | Number | Identifier of the value. This value is used as triggerValueId on the LOAD, RESOLVE, and DELETE endpoints. |
| Name | Text | Name of the value as configured in ASMS Administrator. |
| Key | Text | Key to value. It only comes with value for CatalogList type fields. For List type fields, its value is null. This key can be used as selectedValueKey on the RESOLVE endpoint. |
| catalogId | Number | The identifier of the catalog to which the value belongs. |
| fieldId | Number | The identifier of the field to which the value belongs. For CatalogList type fields, its value is null. |
| order | Number | Order of display of the value on consoles. |
| status | Number | Value status. 1 indicates active, 0 indicates inactive. |
Error messages
| Code | HTTP status | Error Message |
|---|---|---|
| 400 | BadRequest | InvalidItemType — The itemType provided is invalid. |
| 401 | Unauthorized | Token not provided or expired. |