OVERVIEW

API v4.0

API v4.0 requires Synergist v13 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 'jsonapi' with 'xmlapi'
replace '.json?' with '.xml?'

Example:

JSON call

http://<SERVER>/jsonapi/activities.json?company=1&version=4&user=user&password=user&style=modeldata&modelstructure=activitylist

XML call

http://<SERVER>/xmlapi/activities.xml?company=1&version=4&user=user&password=user&style=modeldata&modelstructure=activitylist

JSON/XML - passing data

When using certain CRUD calls the API requires data is passed in the form of a structured array.

JSON call

http://<<SERVER>>/jsonapi/tspending.json?user=user&password=user&version=4&action=update&input={  
  "data": [  
    {  
      "tspEntryNo": 794,  
      "tspHoursNormal": 1.2  
    }  
  ]  
}

XML call

http://<<SERVER>>/xmlapi/tspending.xml?user=user&password=user&version=4&action=update&input=  
<data>  
       <tspEntryNo>794</tspEntryNo>  
       <tspHoursNormal>1.3</tspHoursNormal>  
</data>

To use CSV, make the following changes to the API call:

replace 'jsonapi' with 'csvapi'
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 also specified, the CSV will contain the columns associated with the view - rather than a standard model

example:


http://<SERVER>/csvapi/activities.csv?company=1&version=4&user=user&modelstructure=view&password=user&view=47247