{"id":2748,"date":"2023-12-20T20:37:43","date_gmt":"2023-12-20T20:37:43","guid":{"rendered":"https:\/\/developers.maplink.global\/building-requests-for-the-freight-api\/"},"modified":"2025-08-12T20:49:21","modified_gmt":"2025-08-12T20:49:21","slug":"building-requests-for-the-freight-api","status":"publish","type":"post","link":"https:\/\/developers.maplink.global\/en\/building-requests-for-the-freight-api\/","title":{"rendered":"Building requests for the Freight API"},"content":{"rendered":"\n<p>Before you can start using the API, you will need to <a href=\"https:\/\/developers.maplink.global\/en\/how-do-i-generate-the-token-for-authentication\/\" data-type=\"post\" data-id=\"999\">obtain the <em>authentication token<\/em><\/a>. <\/p>\n\n\n\n<p>The following <em>headers <\/em>will be required, where the word <strong><em>token <\/em><\/strong>must be replaced by the token obtained in the authentication process:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">--header 'Content-Type: application\/json' \\\n--header 'Authorization: Bearer token'<\/pre>\n\n\n\n<p>In <em>body <\/em>all the parameters for calculating the minimum freight for the route will be sent.<\/p>\n\n\n\n<p>The Freight API can be used in 3 different ways:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Independent endpoint<\/strong><\/h2>\n\n\n\n<p>Recommended for users who use third-party routing services.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/api.maplink.global\/freight\/v1\/calculations\">https:\/\/api.maplink.global\/freight\/v1\/calculations<\/a> &#8211; <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">POST<\/mark><\/strong><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Trip API + Freight API<\/strong><\/h2>\n\n\n\n<p>The Freight API can be used in conjunction with the <a href=\"https:\/\/developers.maplink.global\/en\/building-requests-for-the-trip-api\/\" data-type=\"post\" data-id=\"1074\">Trip API<\/a>, both synchronously and asynchronously. The information needed to calculate the freight will be added in the request to the Trip API<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/api.maplink.global\/trip\/v2\/calculations\">https:\/\/api.maplink.global\/trip\/v2\/calculations<\/a> &#8211; <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">POST<\/mark><\/strong><br>Synchronous Trip<br><\/li>\n\n\n\n<li><a href=\"https:\/\/api.maplink.global\/trip\/v1\/problems\">https:\/\/api.maplink.global\/trip\/v1\/problems<\/a> &#8211; <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">POST<\/mark><\/strong><br>Asynchronous Trip <\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Before you can start using the API, you will need to obtain the authentication token. The following headers will be required, where the word token must be replaced by the token obtained in the authentication process: In body all the parameters for calculating the minimum freight for the route will be sent. The Freight API [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[167],"tags":[],"class_list":["post-2748","post","type-post","status-publish","format-standard","hentry","category-freight-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/comments?post=2748"}],"version-history":[{"count":2,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2748\/revisions"}],"predecessor-version":[{"id":3532,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2748\/revisions\/3532"}],"wp:attachment":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/media?parent=2748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/categories?post=2748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/tags?post=2748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}