API v6.0
API v6.0 requires Synergist v15 or higher.
Overview
This document defines the Synergist API which is based on REST.
JSON/XML/CSV
All examples are shown using JSON. However, this API also supports XML.
To use XML, make the following changes to the API call:
- replace
jsonapiwithxmlapi - replace
.json?with.xml?
Example:
JSON call (OAuth 2.0)
http://<SERVER>/jsonapi/activities.json?company=1&version=6&style=modeldata&modelstructure=activitylist
Authorization: Bearer <access_token>JSON call (legacy username/password)
http://<SERVER>/jsonapi/activities.json?company=1&version=6&style=modeldata&modelstructure=activitylist&user=<username>&password=<password>XML call (OAuth 2.0)
http://<SERVER>/xmlapi/activities.xml?company=1&version=6&style=modeldata&modelstructure=activitylist
Authorization: Bearer <access_token>XML call (legacy username/password)
http://<SERVER>/xmlapi/activities.xml?company=1&version=6&style=modeldata&modelstructure=activitylist&user=<username>&password=<password>JSON/XML - passing data
When using certain CRUD calls the API requires data is passed in the form of a structured array.
JSON call (OAuth 2.0)
http://<SERVER>/jsonapi/tspending.json?version=6&action=update&input={
Authorization: Bearer <access_token>
"data": [
{
"tspEntryNo": 794,
"tspHoursNormal": 1.2
}
]
}JSON call (legacy username/password)
http://<SERVER>/jsonapi/tspending.json?version=6&action=update&input={
"data": [
{
"tspEntryNo": 794,
"tspHoursNormal": 1.2
}
]
}&user=<username>&password=<password>XML call (OAuth 2.0)
http://<SERVER>/xmlapi/tspending.xml?version=6&action=update&input=
Authorization: Bearer <access_token>
<data>
<tspEntryNo>794</tspEntryNo>
<tspHoursNormal>1.3</tspHoursNormal>
</data>XML call (legacy username/password)
http://<SERVER>/xmlapi/tspending.xml?version=6&action=update&input=
<data>
<tspEntryNo>794</tspEntryNo>
<tspHoursNormal>1.3</tspHoursNormal>
</data>&user=<username>&password=<password>To use CSV, make the following changes to the API call:
- replace
jsonapiwithcsvapi - replace
.json?with.csv?
Note: Not all API calls support the CSV option. It is only appropriate for listing data. If such
a call is made the server will return a CSV file when possible.
If modelstructure=view, and a view number is also specified, the CSV will contain the columns
associated with the view — rather than a standard model.
Example (OAuth 2.0):
http://<SERVER>/csvapi/activities.csv?company=1&version=6&modelstructure=view&view=47247
Authorization: Bearer <access_token>Example (legacy username/password):
http://<SERVER>/csvapi/activities.csv?company=1&version=6&modelstructure=view&view=47247&user=<username>&password=<password>