Overview
The http GET method is used to query data within Relayware. Field names can be specified to restrict the data returned. By default, data in all available fields is returned. The data returned can also be filtered by setting the filter variable, which accepts simple SQL statements (MS SQL Server).
The following operators can be used in the filter statement:
AND, OR, LIKE, BETWEEN, NOT, <,>,<>,!=,=
When querying a collection, there is a limit to the number of records returned in one request. The
Query Batch Size value can be set as a value between 1 and 2000. The default is 1000. If the number of records returned is greater than this value, then a queryID is returned. This ID must be passed in all subsequent calls to retrieve the rest of the dataset. Keep calling the service with the queryID until the hasMore value is false, which indicates that all records from the query have been retrieved. The totalRecordCount value gives the total number of records returned in the query. The recordCount value returns the number of records returned in the call. On any call in which a queryID is passed, no other parameters are needed.
The GET method filters out any deleted records and any records that the user does not have rights to.
Return:
| Status Code | Error Code | Return | |
|---|---|---|---|
| Success | 200 | A query result. If more records than the Query Batch Size setting value are returned, the following additional fields are returned: QueryID (a pointer to the query);hasMore (set to true); totalRecordCount (the total number of records in the query);recordCount (the number of records returned in the call) | |
| Invalid SQL | 500 | INVALID_SQL | |
| Invalid queryID | 500 | NONEXISTNET_CACHED_QUERRY |
Example:
| Method | URL | Content |
|---|---|---|
| GET |
https://<realaywareHost>/api/v1/person/{personID} https://<relaywareHost>/api/v1/persons |
url-encoded valued |
| HTML Example |
|---|
|
GET/api/v1/persons?fieldlist=firstname,lastname,email&filter=lastname%3D'Smith'%20and%20first name%3D'John' HTTP/1.1 Host:<relaywareHost> sessionID: xxxxxxxxxxxxxxxxxxxxxxxxx |
Comments
0 comments
Please sign in to leave a comment.