Bulk freight archiving

Archiv­ing more than one select­ed freights in one time. You can archive freights with ongo­ing or com­plet­ed pub­li­ca­tion.

Archiv­ing jest avail­able for freight sta­tus unsuccesful_publication and in_progress. Freights with the sta­tus accept­ed are archived freights — per­form­ing the archiv­ing oper­a­tion for the accept­ed or closed freights does not change the freight sta­tus.
The sta­tus of freights not cre­at­ed in the com­pa­ny of the user mak­ing the request will not be changed either.
Archiv­ing is per­formed asyn­chro­nous­ly, which means that archiv­ing all report­ed freight may take a while.

POST
/ext/freights-api/v1/freights/archive
Request Authorization

Every request MUST include a valid access token obtained dur­ing the user autho­riza­tion process, pro­vid­ed using the Bear­er token scheme in the Autho­riza­tion head­er.

Successful 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
AttributeTypeExam­pleManda­to­ryDescrip­tion
freight-idArray of Int[856796, 234578]YesFreight iden­ti­fi­ca­tion num­bers to archive
Example Request Body
[856796, 234578]
Response Fields
AttributeTypeExam­pleDescrip­tion
freightsArray of ObjectsList of request­ed freights to archive
freights.idInt856796Freight iden­ti­fi­ca­tion num­ber
Response Body
{
    "freights": [
        {
            "id": 856796
        },
        {
            "id": 234578
        }
    ]
}

Client errors (code 400)

Val­i­da­tion errors with HTTP sta­tus code 422 indi­cate that the request syn­tax and for­mat are cor­rect, but one or more field val­ues fail val­i­da­tion or busi­ness rules. Below is a list of sam­ple val­i­da­tion 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"
        }
    ]
}