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 |
---|---|
|
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. |
POST parameters
Parameter | Description |
---|---|
|
Filtering conditions. Each condition must contain a field name, value, and a filter operator:
INFO: For the correct spelling of Alloy Navigator Express field names, see Referring to object fields. This is an optional parameter. |
|
A collection of field and direction pairs for sorting:
This is an optional parameter. |
|
Activity fields to show in the result. This is an optional parameter. If missing, the API response includes all available fields. |
|
A number of records to skip. This is an optional parameter. |
|
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 |
---|---|---|
|
List of retrieved data fields. |
Array |
Name
|
Field name. |
String |
|
Field data type. |
String |
|
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 |
---|---|
|
The Authorization header is missing, or the token has expired. |
|
The object class with the specified name was not found. |
|
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" } ] } }