Work management
Get a work order
Retrieve a single work order by ID
GET
/
work-orders
/
{id}
Get a work order
curl --request GET \
--url https://api.oncanary.com/v1/work-orders/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.oncanary.com/v1/work-orders/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.oncanary.com/v1/work-orders/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": {
"id": "<string>",
"title": "<string>",
"description": "<string>",
"type": "preventive",
"status": "open",
"priority": "low",
"requested_by": "<string>",
"creator_id": "<string>",
"assigned_to_user_id": "<string>",
"assigned_to_team_id": "<string>",
"asset_id": "<string>",
"location_id": "<string>",
"due_date": "2023-11-07T05:31:56Z",
"scheduled_start": "2023-11-07T05:31:56Z",
"estimated_hours": 4999.995,
"recurrence_info": {
"type": "DAILY",
"interval": 1,
"days": [
"SUNDAY"
],
"day": 16
},
"previous_id": "<string>",
"next_id": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"completer_id": "<string>",
"completion_summary": "<string>",
"inventory_reconciliation_required": true,
"image_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"extraFields": {}
},
"meta": {
"request_id": "<string>",
"api_version": "<string>"
}
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}⌘I
Get a work order
curl --request GET \
--url https://api.oncanary.com/v1/work-orders/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.oncanary.com/v1/work-orders/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.oncanary.com/v1/work-orders/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": {
"id": "<string>",
"title": "<string>",
"description": "<string>",
"type": "preventive",
"status": "open",
"priority": "low",
"requested_by": "<string>",
"creator_id": "<string>",
"assigned_to_user_id": "<string>",
"assigned_to_team_id": "<string>",
"asset_id": "<string>",
"location_id": "<string>",
"due_date": "2023-11-07T05:31:56Z",
"scheduled_start": "2023-11-07T05:31:56Z",
"estimated_hours": 4999.995,
"recurrence_info": {
"type": "DAILY",
"interval": 1,
"days": [
"SUNDAY"
],
"day": 16
},
"previous_id": "<string>",
"next_id": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"completer_id": "<string>",
"completion_summary": "<string>",
"inventory_reconciliation_required": true,
"image_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"extraFields": {}
},
"meta": {
"request_id": "<string>",
"api_version": "<string>"
}
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}