Summary
Requirements
All API calls require a dedicated JSON Web Token (JWT). These are created when a user with a dedicated mobile resource logs in to the application. If you are using the API for programmatic queries, it is best to create a dedicated user for the JWT as this gets reset each time the user logs in.
Endpoint
/rest/workflow/job/cancelJob
POST
Cancels a job in Oneserve, leaving an event in the job history with notes passed in the message
field.
File Format Spec
List of included fields
Field Name
Data Type
Mandatory?
Description
clientId
Integer
Yes
The ID of the client in Oneserve
clientRef
Text (50)
Yes if
jobRef
not specifiedThe client reference of the job in Oneseve
jobRef
Text (50)
Yes if
clientRef
not specifiedThe job reference in Oneserve
message
Text (1000)
Yes
The notes against the event in Oneserve
cancellationType
Integer
Yes
0 - Not Selected
1 - Cancel
2 - Abort
reasonId
Integer
Yes
The note ID in Oneserve
date
Date
No (defaults to current date)
The date of cancellation
Request Representations
Example JSON Payload
{
"clientId":"1",
"clientRef":"J023T1",
"jobRef":"J023T1",
"message":"Job cancelled due to bad weather",
"cancellationType":"1",
"reasonId":"1",
"date":"13/07/2020"
}
Available Response Representations
HTTP Code | Description | Schema |
---|---|---|
200 | Job(s) cancelled | Success or error |
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
This error occurs if the Verify your This error indicates that something is blocking your connection to the server Open a ticket with the support team with details of your connection so that your access can be verfied 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 Verify the endpoint matches the value specified in this article This error will occur if an unacceptable method has been used in the call such as Ensure that you are using a This error occurs when a mandatory field has not been included in the call Make sure that your call includes the information specified in the spec above401 Unauthorized
Response
401 Unauthorized
Reason
OS_REST_AUTH_TOKEN
has not been provided, has expired, or does not exist in the systemResolution
OS_REST_AUTH_TOKEN
with support403 Forbidden
Response
403 Forbidden
Reason
Resolution
404 Not Found
Response
404 Not Found
Reason
Resolution
405 Method Not Allowed
Response
405 Method Not Allowed
Reason
GET
or DELETE
Resolution
POST
call to this endpointJSONObject [field name] not found
Response
{
"result": "fail",
"result_msg": "JSONObject [field] not found."
}
Reason
Resolution