addEvent API

Follow

Summary

The addEvent endpoint allows you to publish job events to jobs by passing details to a URL containing the Oneserve job reference.

Endpoint

/rest/workflow/job/addEvent/{jobRef}

POST

Adds an event to a job specified in the call.

File Format Spec

 

List of included fields
Field Name Data Type Mandatory? Description
sigEventCode Text (6) Yes The code of the event in Oneserve
appointmentId Integer No The ID of the appointment to which the event is linked
note Text (1000) Yes The description of the event
noteId Integer No The ID of the note to be used on the job
date DateTime Yes The date the event was recorded

 

Request Representations

 

JSON payload example
event={
  "sigEventCode":"N",
  "appointmentId":"42923",
  "noteId":"81",
  "note":"This is a note to be added to a job",
  "date":"13-07-2020 13:45:00"
}

 

Available Response Representations

HTTP Code Description Schema
200 Event(s) Posted "result": "success"
400 Bad Request Error
401 Unauthorized Error
403 Forbidden Error
404 Address Not Found Error
405 Method Not Allowed Error
500 Internal Server Error Error

Example Success Response

{
    "result": "success",
    "result_msg": ""
}

Troubleshooting

 

401 Unauthorized

Response

401 Unauthorized

Reason

This error occurs if the OS_REST_AUTH_TOKEN has not been provided, has expired, or does not exist in the system

Resolution

Verify your OS_REST_AUTH_TOKEN with support

403 Forbidden

Response

403 Forbidden

Reason

This error indicates that something is blocking your connection to the server

Resolution

Open a ticket with the support team with details of your connection so that your access can be verfied

404 Not Found

Response

404 Not Found

Reason

This error should only occur if the endpoint has been mistyped in some way, which will lead the call to an endpoint that does not exist

Resolution

Verify the endpoint matches the value specified in this article

405 Method Not Allowed

Response

405 Method Not Allowed

Reason

This error will occur if an unacceptable method has been used in the call such as GET or DELETE

Resolution

Ensure that you are using a POST call to this endpoint

 

Was this article helpful?
0 out of 0 found this helpful