Archiving more than one selected freights in one time. You can archive freights with ongoing or completed publication.
Archiving jest available for freight status unsuccesful_publication and in_progress. Freights with the status accepted are archived freights — performing the archiving operation for the accepted or closed freights does not change the freight status.
The status of freights not created in the company of the user making the request will not be changed either.
Archiving is performed asynchronously, which means that archiving all reported freight may take a while.
POST
/ext/freights-api/v1/freights/archive
Request Authorization
Every request MUST include a valid access token obtained during the user authorization process, provided using the Bearer token scheme in the Authorization header.
Successful Response
Error Response
Request Header
POST /ext/freights-api/v1/freights/archive HTTP/1.1
Host: api.platform.trans.eu
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access_token)
Api-key: {unique_app_api-key}Request Parameters
| Attribute | Type | Example | Mandatory | Description |
| freight-id | Array of Int | [856796, 234578] | Yes | Freight identification numbers to archive |
Example Request Body
[856796, 234578]Response Fields
| Attribute | Type | Example | Description |
| freights | Array of Objects | List of requested freights to archive | |
| freights.id | Int | 856796 | Freight identification number |
Response Body
{
"freights": [
{
"id": 856796
},
{
"id": 234578
}
]
}Client errors (code 400)
Validation errors with HTTP status code 422 indicate that the request syntax and format are correct, but one or more field values fail validation or business rules. Below is a list of sample validation errors.
Example error 1
No freights id in request
{
"detail": "Failed Validation",
"status": 422,
"title": "Unprocessable Entity",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
"validation_messages": [
{
"isEmpty": "Value is required and can't be empty"
}
]
}