API User's Guide

Retrieving object classification values (GET)

Introduced in 8.5

Description

The API provides the ability to retrieve classification values about Alloy Navigator objects. You can specify filtering and sorting criteria for returned objects. You can also specify which field values you want to retrieve.

HTTP method

GET

API URL

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

GET parameters (query string)

The following parameters should be specified in the URL query string.

Parameter Description

objectClass

Object class name.

Examples:

Incidents

Computers

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

refField

Reference field name.

Examples:

Statuses

Types

Additional Parameters

par_sort_desc

Fields by which to sort the result in descending order. Fields must be separated by a comma.

This is an optional parameter. Note that only one sorting direction can be specified, either par_sort_desc or par_sort_asc.

INFO: For the correct spelling of Alloy Navigatorfield names, see Referring to object fields.

par_sort_asc

Fields by which to sort the result in ascending order. Fields must be separated by a comma.

This is an optional parameter. Note that only one sorting direction can be specified, either par_sort_desc or par_sort_asc.

par_fields

Comma-separated list of field names to include in the result.

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

par_offset

Specifies the number of records to skip. Should be used in conjunction with par_limit to paginate results.

This is an optional parameter.

par_limit

Specifies the number of records to return. Can be used in conjunction with par_offset to paginate results.

This is an optional parameter.

<fieldName1>

<fieldName2>

...

Filtering criteria.

Example:

Priority=High

This is an optional parameter.

NOTE: Note that the URL length is limited by the web server settings. If your parameters push the total size of the URL over limit you should use the POST request. For details, see Retrieving object classification values (POST).

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.

NOTE: If the user is not authorized to access the object class, the returned Data array will be empty.

Example

This is an example of how you can specify fields that you want to be retrieved. Below is a request for Statuses and Ranks of the Computers objects, where Rank=3.

Request:

(GET) http://www.example.com/api/v2/Dictionary?par_objectClass=Computers&par_refField=Status&Rank=3

Response:

{
	"success": true,
	"errorCode": 0,
	"errorText": "",
	"responseObject": {
		"Fields": [
		{
			"Name": "Rank",
			"DataType": "int"
		},
		{
			"Name": "Satus",
			"DataType": "string"
		}
		],
		"Data": [
		{
			"2",
			"In Stock",
		}
		]
	}
}