Overview
This document defines the Synergist API which is based on REST.
A request needs to include the parameters required for the action being taken. The Synergist username and password are always mandatory parameters. For example:
GET /xmlapi/companies.xml?user=MyUser&password=<password>&page=0&rows=0
(example in a browser: http://dev/xmlapi/companies.xml?user=user&password=user&page=1&rows=10)
or
GET /xmlapi/companies.xml?user=MyUser&md5password=<passwordmd5hashed>&page=1&rows=10)
would retrieve an XML structure containing all valid companies that the supplied user has access to.
General parameters for all requests
GET /xmlapi/companies.xml?user=MyUser&md5password=<passwordmd5hashed>&page=0&rows=0
would retrieve an XML structure containing all valid companies that the supplied user has access to.
| parameter | meaning |
|---|---|
| user | Synergist login ID |
| password | synergist password or md5password |
| page (optional) | Data page to return, page numbering starts at 0 |
| rows (optional) | Number of records/rows to return. 0 = return all rows](http://google.com) |
Response
When a response is sent which contains multiple records, the root element of the XML tree will have the following attributes:
| attribute | meaning |
|---|---|
| TotalRows | this will be the total number of records/rows in the selection, regardless of page requested |
| TotalPages | this will be the total number of pages available, based on the rows parameter supplied |
| MorePages | this will be True if further pages of data are available or False if you have fetched the last page |
In case of any error, the Synergist server will return an HTTP 404 error together with a structure containing the error details:
<Errors>
<Error>
<ErrorID>404004</ErrorID>
<ErrorText>request not recognised</ErrorText>
</Error>
</Errors>
The following table lists errors that apply to all requests:-
| error id | error text |
|---|---|
| 404001 | no credentials supplied |
| 404002 | invalid credentials supplied |
| 404003 | account disabled |
| 404004 | request not recognised |
