Discussions

Ask a Question
Back to All

Create Job and Update Job Module

Is Create Job and Update Job is the same? If the UUID parameter from the Create Job does have a value? I tried running it in the API Reference, it did succeed but when I was doing an API call on my code the values didnt change in ServiceM8.

Admin

The format that you send to the endpoint is the same - i.e. a JSON with fields that you want to set/update.

For creating jobs, you post that JSON to https://api.servicem8.com/api_1.0/Job.json

When you create a job, the UUID of the job you just created is available in the "x-record-uuid" HTTP header of the response.

For updating jobs, you post that JSON to https://api.servicem8.com/api_1.0/Job/{uuid}.json where {uuid} is the UUID of the job you want to update.

So basically it wont update even though same format?

Admin

If you post to the "create" endpoint, then no it won't update because the "create" endpoint cannot specify which record to update. It would create a new one with the same details.