Work management
Update a work request
PATCH
/
workrequests
/
{id}
Update a work request
curl --request PATCH \
--url https://api.oncanary.com/v1/workrequests/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "<string>",
"assetId": "<string>",
"locationId": "<string>",
"approverTeamId": "<string>",
"creatorContactInfo": "<string>",
"extraFields": {}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
assetId: '<string>',
locationId: '<string>',
approverTeamId: '<string>',
creatorContactInfo: '<string>',
extraFields: {}
})
};
fetch('https://api.oncanary.com/v1/workrequests/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.oncanary.com/v1/workrequests/{id}"
payload = {
"title": "<string>",
"description": "<string>",
"assetId": "<string>",
"locationId": "<string>",
"approverTeamId": "<string>",
"creatorContactInfo": "<string>",
"extraFields": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"workRequest": {
"id": "<string>",
"title": "<string>",
"attachments": [
{
"id": "<string>",
"mimeType": "<string>",
"fileName": "<string>",
"url": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"width": 123,
"height": 123
}
],
"priority": "NONE",
"requestStatus": "PENDING",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"thumbnail": {
"id": "<string>",
"mimeType": "<string>",
"fileName": "<string>",
"url": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"width": 123,
"height": 123
},
"description": "<string>",
"assetId": "<string>",
"locationId": "<string>",
"workOrderId": "<string>",
"sendEmailNotification": true,
"extraFields": {},
"approverTeamId": "<string>",
"creatorContactInfo": {
"type": "PHONE",
"value": "<string>"
},
"asset": {},
"location": {},
"workOrder": {}
}
}{
"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"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}Authorizations
Organization API key with an sk_live_ or sk_test_ prefix
Path Parameters
Resource ID
Body
application/json
Maximum string length:
255Maximum string length:
4000Available options:
NONE, LOW, MEDIUM, HIGH Maximum string length:
512Show child attributes
Show child attributes
Response
Updated work request
Show child attributes
Show child attributes
⌘I
Update a work request
curl --request PATCH \
--url https://api.oncanary.com/v1/workrequests/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "<string>",
"assetId": "<string>",
"locationId": "<string>",
"approverTeamId": "<string>",
"creatorContactInfo": "<string>",
"extraFields": {}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
assetId: '<string>',
locationId: '<string>',
approverTeamId: '<string>',
creatorContactInfo: '<string>',
extraFields: {}
})
};
fetch('https://api.oncanary.com/v1/workrequests/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.oncanary.com/v1/workrequests/{id}"
payload = {
"title": "<string>",
"description": "<string>",
"assetId": "<string>",
"locationId": "<string>",
"approverTeamId": "<string>",
"creatorContactInfo": "<string>",
"extraFields": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"workRequest": {
"id": "<string>",
"title": "<string>",
"attachments": [
{
"id": "<string>",
"mimeType": "<string>",
"fileName": "<string>",
"url": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"width": 123,
"height": 123
}
],
"priority": "NONE",
"requestStatus": "PENDING",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"thumbnail": {
"id": "<string>",
"mimeType": "<string>",
"fileName": "<string>",
"url": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"width": 123,
"height": 123
},
"description": "<string>",
"assetId": "<string>",
"locationId": "<string>",
"workOrderId": "<string>",
"sendEmailNotification": true,
"extraFields": {},
"approverTeamId": "<string>",
"creatorContactInfo": {
"type": "PHONE",
"value": "<string>"
},
"asset": {},
"location": {},
"workOrder": {}
}
}{
"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"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}