Retrieving Object Classification Values (POST)

Introduced in 8.5

Using the POST method, you can overcome the HTTP query length limitations. This request uses the same set of parameters and produces the identical results as GET method described in the section Retrieving Object Classification Values (GET).

HTTP Method

POST

API URL

http://www.example.com/api/v2/Dictionary

POST parameters
Parameter Description

objectClass

The object class name.

Examples:

Tickets

Computers

INFO: For the correct spelling of Alloy Navigator Express object class names, see Supported Alloy Navigator Express Object Classes.

refField

The reference field name.

Examples:

Statuses

Types

Additional Parameters

filters

The filtering conditions. Each condition must contain a field name, value, and a filter operator:

  • name – a field to filter the data records by.
  • value – a value to use in the filtering operation.
  • operation – a filter operator: equal (=), not equal (<>). For numeric and date values, filtering conditions also support using additional comparison operators, such as: >, >=, <, <=.

INFO: For the correct spelling of Alloy Navigator Express field names, see Referring to Object Fields in Alloy Navigator Express API.

This is an optional parameter.

sort

The collection of field and direction pairs for sorting:

  • property – a field to sort by.
  • direction – sorting order: ascending (asc), or descending (desc).

This is an optional parameter.

fields

The fields to show in the result.

This is an optional parameter. If missing, the API response includes all available fields.

offset

The number of records to skip. This is an optional parameter.

limit

The number of records to show in the result. This is an optional parameter.

POST parameters should be specified in the request’s body, in JSON format.

POST body format:
{

	"filters":[

	{

		"name": "<filterName>",

		"value": "<filterValue>",

		"operation": "<filterOperation>"

		},

		...

	],

	"sort":[

	{

		"property":"<sortProperty>",

		"direction": "<sortDirection>"

		},

		...

	],



	"fields": ["<field1>", "<field2>",...],

		"offset": "<offset>",

		"limit": "<limit>"

}
Response Format

Object data is returned as two arrays:

  • Fields - The name and data type of the fields specified in the request.
  • Data - Field values for each object record.
{

	"success": true,

	"errorCode": 0,

	"errorText": "",

	"responseObject": {

		"Fields": [

		{

			"Name": "Field_1",

			"DataType": "string/int/guid/..."

		},

		{

			"Name": "Field_2",

			"DataType": "string/int/guid/..."

		},

		//...

		],

		"Data": [

			["Field_1 data","Field_2 data",...],

			//...

		]

	}

}
Property Description Format

Fields

List of retrieved data fields.

Array

Name

Field name.

String

DataType

Field data type.

String

Data

The Data array. Object records are returned as nested arrays. Field values are listed in the same order as field definitions in the Fields array.

Array

In case of an invalid request the server returns an error message. The following errors may appear:

Error message Description

Authorization has been denied for this request.

The Authorization header is missing, or the token has expired.

Requested object is of unknown class.

The Object Class with the specified name was not found.

Field <name> is unknown.

The field with the specified name was not found.

If the user is not authorized to access the Object Class, returned Data array will be empty.

Example

Here is an example of how you can obtain Statuses and Ranks of the Computers objects, sorted in ascending order by the Rank field, filtered by Rank>1.

Request:

(POST) http://www.example.com/api/v2/Dictionary

POST Body:

{

	"refField": "Status",

	"objectClass": "Computers",

	"sort":[

	{

		"property":"Rank",

		"direction": "asc"

	}

	],

	"limit": 0,

	"offset": 0,

	"fields":[

	{

		"Rank",

		"Status",

	}

	],

	"filters":[

	{

		"name": "Rank",

		"operation": ">",

		"value": "1"

	}

	],	

}

Response:

{

	"success": true,

	"errorCode": 0,

	"errorText": "",

	"responseObject": {

		"Fields": [

		{

			"Name": "Rank",

			"DataType": "int"

		},

		{

			"Name": "Satus",

			"DataType": "string"

		}

		],

		"Data": [

		{

			"2",

			"In Stock",

		},

		{

			"3",

			"In Repair",

		},

		{

			"4",

			"Missing",

		},

		{

			"5",

			"Retired",

		}

		]

	}

}