<< Click to Display Table of Contents >> Navigation: API requests > Get Relations |
You can find extra information about how relations work in TimeWriter Pro here.
API request
Name: GetRelations
API request structure
<?xml version="1.0" encoding="UTF-8"?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <S:Body> <ns2:GetRelations xmlns:ns2="api.timewriter.nl"> <securityToken></securityToken> <id1></id1> <id2></id2> <relationType></relationType> <filters> <filter> <field></field> <operator></operator> <value></value> </filter> ... </filters> </ns2:GetRelations> </S:Body> </S:Envelope> |
Explanation
Tag/field name |
Type |
Remark |
Description |
securityToken |
string |
mandatory |
securityToken obtained at log in |
id1 |
long |
aspect id |
|
id2 |
long |
aspect id or -1 |
|
relationType |
mandatory Must have a value from RelationType or use * to get all Relations. |
relatietype |
|
filters |
List<Filter> |
optional Apart from the id1/id2/relationType filter this filter can be used for filtering on the field TIMESTAMP. Changes can be fetched using this. |
filter list for Relation fields (check Response structure and Explanation below) See also Filter For only fetching the changed data check the: Filter -> Example |
Limit
A maximum of 100000 relations can be returned per request.
If the request will yield more than 100000 relations, no relations will be returned and it will be reported in the errorMessage field of the response.
Examples
This example will get all relations seen from the aspect with id 789 (using id1):
|
---|
This example checks if an employee is authorized to create hour bookings to all Customers (aspect 1)
If the response has got just one relation, the id2 must be -1. This means the employee can book on all customers.
The employee can create hour bookings for all employees from this result:
|
---|
API response
Name: GetRelationsResponse
API response structure
<?xml version="1.0" encoding="utf-8"?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <S:Body> <ns2:GetRelationsResponse xmlns:ns2="api.timewriter.nl"> <result> <error></error> <errorMessage></errorMessage> <relationList> <relation> <id1></id1> <id2></id2> <relationType></relationType> </relation> ... </relationList> </result> </ns2:GetRelationsResponse> </S:Body> </S:Envelope> |
Explanation
Tag/field name |
Type |
||||||||||||
result |
RequestResult
|