Cancel freight publication

Active freight pub­li­ca­tion can be deac­ti­vat­ed. It removes the freight from the list of freights vis­i­ble to car­ri­ers. Ongo­ing nego­ti­a­tions with car­ri­ers are being reject­ed.
Deac­ti­va­tion is pos­si­ble for freight pub­lished by any employ­ee in your com­pa­ny.

The freight-id iden­ti­fi­ca­tion num­ber in method call can be tak­en from response after cre­at­ing the freight or by down­load­ing the freight list.

POST
/ext/freights-api/v1/cancelPublication/{freight-id}
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/cancelPublication/{freight-id} 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}
Successful Response
201 Created

Client errors (code 400)

HTTP 4xx sta­tus codes indi­cate client errors, mean­ing that the request could not be processed due to an issue on the client side. Below is a list of request-spe­cif­ic errors.

Example error 1

Freight does not exists

{
    "detail": "Page not found.",
    "status": 404,
    "title": "Not Found",
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Example error 2

Incor­rect freight sta­tus to refresh

{
    "detail": "Cancellation is not possible. Status of publication 'finished' is forbidden",
    "status": 422,
    "title": "Unprocessable Entity",
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}