Retrieving Object Activities (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 Activities (GET).

HTTP Method

POST

API URL

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

URL Parameters
Parameter Description

oid

Object identifier. For more information, see Identification of Objects 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.

POST parameters
Parameter Description

filters

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

A 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

Activity fields to show in the result.

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

offset

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

limit

A 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 a list of Activities with set of fields: Num, Details, Activities, Created_Date; sorted in descending order by the field Num, filtered by Created Date=2019-12.

Request:

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

POST Body:

{

	"offset": 0,

	"sort":[

	{

		"property":"Num",

		"direction": "desc"

	}

	],
	"limit": 0,

	"fields":[

	{

		"Num",

		"Details",

		"Activity"

		"Created_Date"

	}

	],

	"filters":[

	{

		"name": "Created_Date",

		"operation": "=",

		"value": "2019-12"

	}

	],	

}

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"

		}

		]

	}

}