Change work report settings
const url = 'https://example.com/work-report/settings';const options = { method: 'PUT', headers: { cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"enabled":true,"emailTo":"main_contact","sendAfter":"tracked","nextNumber":1,"acknowledgement":["example"],"mustRecord":{"cylinderDetails":true,"allChecks":true,"customerSignature":true,"driverSignature":true,"purchaseOrder":true}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/work-report/settings \ --header 'Content-Type: application/json' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token> \ --data '{ "enabled": true, "emailTo": "main_contact", "sendAfter": "tracked", "nextNumber": 1, "acknowledgement": [ "example" ], "mustRecord": { "cylinderDetails": true, "allChecks": true, "customerSignature": true, "driverSignature": true, "purchaseOrder": true } }'Fields left out keep their value. Blank acknowledgement lines are dropped. The next report number must be higher than the highest report already issued; a lower one is refused with 422.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Main_contact: the customer’s main contact. everyone: every contact on the account. ask_driver: the driver picks at the stop.
Tracked: stops where a tracked cylinder is delivered or collected. every: every stop.
object
Responses
Section titled “Responses”Saved
object
Main_contact: the customer’s main contact. everyone: every contact on the account. ask_driver: the driver picks at the stop.
Tracked: stops where a tracked cylinder is delivered or collected. every: every stop.
object
Example
{ "emailTo": "main_contact", "sendAfter": "tracked"}Not signed in
object
Example
{ "error": "not_found", "message": "Customer not found"}Not an owner or admin, or the plan does not open Assets
object
Example
{ "error": "not_found", "message": "Customer not found"}Not found, or Assets is not available to this business
object
Example
{ "error": "not_found", "message": "Customer not found"}Assets is switched off, or the business already has 50 job types or checks
object
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
object
object
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}