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/activity/addActivityByClientRef
POST
Adds an activity to a job using the client ref and client to look up the job. Changes will only impact the most recent version of a job.
If versioning is enabled and the user doesn't have the rights to create a version an error message will be returned. If versioning is not enabled the activities will be added without a version being created.
If the submitVersion
flag is set to 1 the version will also be submitted (if versioning is switched on). If set to 0 the version will not be submitted. If versioning is switched off the submitVersion flag will be ignored.
File Format Spec
List of included fields
Field Name
Data Type
Mandatory?
Description
activities
Array
Yes
An array of activity objects
jobClientRef
Text (50)
Yes
The client ref of the job
clientId
Integer
Yes
The ID of the client
code
Text(20)
Yes
The code of the activity to be added
clientRef
Text (50)
Yes
The client reference of the activity
description
Text (1000)
No
The description of the activity
completedQuantity
Decimal
Yes
The completed quantity of the activity
totalQuantity
Decimal
Yes
The total quantity of the activity on the job
submitVersion
Boolean
No
0 - Does not submit a new version of the job
1 - Submits a new version of the job
Request Representations
Example JSON Payload
{
"activities": [
{
"jobClientRef": "J023T4",
"clientId": "28",
"code": "REPAIR",
"clientRef": "REPAIR",
"description": "An activity description",
"completedQuantity": "3",
"totalQuantity": "3"
}
],
"submitVersion": "1"
}
Available Response Representations
HTTP Code | Description | Schema |
---|---|---|
200 | Activity(ies) 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
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 response is given if no active library activity or costs can be found for the client/work log type in question Ensure that the activity exists in Oneserve and has valid costs for the job in question This error occurs if a non-numeric value is passed to a number-only field Ensure that all fields are filled out account to the spec above This error occurs if a mandatory field is missing from the call Ensure that all fields are filled out per 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 endpointNo active library activity with code found
Response
{
"result": "fail",
"result_msg": "REST0001",
"result_error_msg": "No active library activity with code: <yourcode> found for client id: 28, wlt: 47"
}
Reason
Resolution
JSONObject is not a number
Response
{
"result": "fail",
"result_msg": "REST0001",
"result_error_msg": "JSONObject["completedQuantity"] is not a number."
}
Reason
Resolution
JSONObject ... not found
Response
{
"result": "fail",
"result_msg": "REST0001",
"result_error_msg": "JSONObject["clientRef"] not found."
}
Reason
Resolution