Passing data array to an API request

Passing data to an API request

If creating or updating a record in Synergist you will typically need to pass data to the API request via a JSON array. The field names can be ascertained by first making a simple request for a record and passing the modelstructure parameter.
see Using data models

Making such a call will return an example record and from this, you will be able to see all the required field names.

Once you know the field names to use you can make an API request like the one below - passing the data in the input data array:

e.g.

http:///jsonAPI/jobs.json?user=user&password=user&action=create&company=8&version=3.9&input={
"data": [
{
"varJobTemplate": "8/00800001",
"jobHandleruserid": "3",
"jobClientCode": "8/1244",
"jobJobtypeCode": "8/10",
"jobNumber": "8/00MJP20",
"jobDescription": "My new job description",
"jobDateIn": "2017/12/06",
"jobDateDue": "2017/12/07",
"jobHandlerTeam": "8/DQS",
"jobStatus": "2",
"jobContactInternalRef": 8600,
"jobProjectCode": 388,
"jobCampaignNo": 268
}
]
}