After creating an order you can add an attachment to it (option available for not cancelled orders only).
Adding an attachment takes two steps — uploading a file and adding it to a specific order.
You can also download a file attached to an order.
Authorization and access
Authorization process is described here. Each API request must also consist of unique Api-key obtained during application registration together with client_id and client_secret.
Adding file to an order url parameters
- URL: https://api.platform.trans.eu
- Endpoint: /orders-api/v1/orders/{orderId}/attachments
- Http Method: POST
Description of fields:
Name | Type | Example | Description |
media_id | string | eb6bd829-0794–4553-8d8f-7f000ea76d15 | Id of previously uploaded file |
media_name | string | Media name | File name |
description | string | Documentation | File description (maximum 200 characters) |
type_id | string | Waybill | One of the following: waybill, transport_order, cession_scan, cargo_photo, invoice_scan, cmr, other |
visible_to_contractor | Boolean | True | Defines if file should be visible to contractor |
Json example
{
"media_id": "eb6bd829-0794-4553-8d8f-7f000ea76d15",
"media_name": "Media name",
"description": "Documentation",
"type_id": "Waybill",
"visible_to_contractor": true
}
Json response example
{}
Downloading file from an order
In order to download an attachment you have to give media_id which you’ll find in attachments object.
Delete attachement of an order
- URL: https://api.platform.trans.eu
- Endpoint: /orders-api/v1/orders/:orderId/attachments/:attachmentId
- Http Method: DELETE
Response
Response for properly given freight id is Http code 204 with no response content.