Service task file
Reserve and upload a file to attach to a service task.
A service task can carry files: an invoice, a photograph of the work, a signed job sheet. This operation reserves one and returns the credentials for uploading it.
The exchange works the same way as for task form files. Reserving the file is the first step, uploading it to the returned URL is the second, and every file counts against the account's file storage quota.
API actions
API base path: /vehicle/service_task/file.
Operations that list no errors of their own return only the general error codes.
Creates a file to specify its ID in service work later.
Upload with a POST multipart request to the returned url: send the values from fields first, then the file part last, named as file_field_name says. token authenticates the upload.
Reserve a file so its ID can be attached to a service work later. Returns an upload URL and the fields to send with it.
Upload with a POST multipart request to the returned url, sending the values from fields first and the file part last, named as file_field_name says.
Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.
Maximum size in bytes of the file to be uploaded. Reserves that much of the disk quota.
Optional. Name to store the file under. Taken from the upload form when omitted.
Optional. Default file.
Where and how to upload
true if request finished successfully.
trueBad request. The response body carries the API-level error code in status.code. Validation failures also include an errors array naming each offending parameter.
Error response object
POST /v2/vehicle/service_task/file/create HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 93
{
"size": 1,
"filename": "text",
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"type": "image"
}{
"success": true,
"value": {
"file_id": 1,
"url": "text",
"expires": "text",
"file_field_name": "text",
"fields": {
"token": "text",
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}
}Last updated
Was this helpful?