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/addActivity
POST
Adds an activity to an appointment, with optional fields for site locations and activity notes.
File Format Spec
List of included fields
Field Name
Data Type
Mandatory?
Description
activities
Array
Yes
An array of activity objects
code
Text (200)
Yes
The activity code in Oneserve
appointmentId
Integer
Yes
The ID of the appointment
totalQuantity
Decimal
Yes
The quantity of activities to be added
completedQuantity
Decimal
Yes
The completed quantity of the activity
note
Text (1000)
No
The description of the activity
siteLocationId
Integer
No
The ID of the associated site location
activityGroupId
Integer
No
The ID of the activity group to which the activity belongs
Request Representations
Example JSON Payload
{
"activities": [
{
"code": "REPAIR",
"appointmentId": "42923",
"totalQuantity": 2,
"completedQuantity": "0",
"note": "Some activity notes",
"siteLocationId": "901",
"activityGroupId": "5"
}
]
}
Available Response Representations
HTTP Code | Description | Schema |
---|---|---|
200 | Job(s) Posted | activities [array]activityId Intcode TextactivityVersion Int |
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
{
"activities": [
{
"activityId": "137128",
"code": "REPAIR",
"activityVersion": "0"
}
],
"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 the ID passed in the Ensure that the site location ID being posted exists in the system401 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
Unable to find site location with id
Response
{
"result": "fail",
"result_msg": "REST0001",
"result_error_msg": "Unable to find site location with id: 2147483647"
}
Reason
siteLocationId
does not match an existing value in the systemResolution