Summary
The addEventByClientRef
endpoint allows you to publish job events to jobs by passing the sigEventCode
and jobClientRef
.
Endpoint
/rest/workflow/job/addEventByClientRef
POST
Adds a Job Event. Looks up job by jobRef
if not blank, otherwise by jobClientRef
and clientId
.
File Format Spec
List of included fields
Field Name | Data Type | Mandatory? | Description |
---|---|---|---|
jobRef |
Text (50) | Yes if jobClientRef not provided |
The ref of the job in Oneserve |
jobClientRef |
Text (50) | Yes if jobRef not provided |
The client ref of the job |
clientId |
Integer | Yes | The ID of the client |
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
{
"jobRef":"J023T4",
"jobClientRef":"J023T4",
"clientId":"28",
"sigEventCode":"N",
"appointmentId":"42923",
"noteId":"81",
"note":"This is a note to be added to a job",
"date":"13-07-2020 13:48: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