API User's Guide

Retrieving object activities (GET)

Introduced in 8.5

Description

The API provides the ability to retrieve information from Alloy Navigator Express object Activities. You can specify filtering and sorting criteria for returned object data. You can also specify which data fields you want to retrieve.

HTTP method

GET

API URL

http://www.example.com/api/v2/Activities/<oid>

URL parameters
Parameter Description

oid

Object identifier. For more information, see Object identification in Alloy Navigator Express.

NOTE: This HTTP request can not be used to query objects that belong in the Software Catalog and Stock Room sections of the product.

GET parameters (query string)

Additional parameters should be specified in the URL query string.

Parameter Description

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. Only one sorting direction can be specified, either par_sort_desc or par_sort_asc.

INFO: For the correct spelling of Alloy Navigator Express field names, see How to refer to object fields when retrieving objects.

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. Only one sorting direction can be specified, either par_sort_desc or par_sort_asc.

par_fields

Comma-separated list of Activity 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 activities (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

Here is an example of how you can obtain a list of Activities with set of fields: Num, Details, Activities, Created_Date; sorted in descending order by the field Num.

Request:

(GET) http://www.example.com/api/v2/Activities/T000027?par_fields=Num,Details,Activity,Created_Date&par_sort_desc=Num&par_limit=0&par_offset=0&

Response:

{
	"success": true,
	"errorCode": 0,
	"errorText": "",
	"responseObject": {
		"Fields": [
		{
			"Name": "Num",
			"DataType": "int"
		},
		{
			"Name": "Details",
			"DataType": "Memo"
		},
		{
			"Name": "Activity",
			"DataType": "memo"
		}
		{
			"Name": "Created_Date",
			"DataType": "datetime"
		}
		],
		"Data": [
		{
			"3",
			"",
			"Due Date Violation",
			"2019-12-12T09:30:25-08:00"
		},
		{
			"2",
			"",
			"Response Date Violation",
			"2019-12-12T09:30:06-08:00"
		},
		{
			"1",
			"",
			"New Technical Issue was created",
			"2019-12-07T17:23:51-08:00"
		}
		]
	}
}