Active freight publication can be deactivated. It removes the freight from the list of freights visible to carriers. Ongoing negotiations with carriers are being rejected.
Deactivation is possible for freight published by any employee in your company.
The freight-id identification number in method call can be taken from response after creating the freight or by downloading the freight list.
POST
/ext/freights-api/v1/cancelPublication/{freight-id}
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.
Request
Successful Response
Error 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 CreatedClient errors (code 400)
HTTP 4xx status codes indicate client errors, meaning that the request could not be processed due to an issue on the client side. Below is a list of request-specific 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
Incorrect freight status 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"
}