{"id":2613,"date":"2023-12-18T14:23:56","date_gmt":"2023-12-18T14:23:56","guid":{"rendered":"https:\/\/developers.maplink.global\/building-requests-for-the-toll-api\/"},"modified":"2025-02-06T14:40:27","modified_gmt":"2025-02-06T14:40:27","slug":"building-requests-for-the-toll-api","status":"publish","type":"post","link":"https:\/\/developers.maplink.global\/en\/building-requests-for-the-toll-api\/","title":{"rendered":"Building requests for the Toll 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 will be sent to obtain the values of the tolls on the route.<\/p>\n\n\n\n<p>The Toll API can be used in two different ways:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Independent endpoint<\/strong><\/h2>\n\n\n\n<p>Suitable for users who consume third-party routing services.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/api.maplink.global\/toll\/v1\/calculations\">https:\/\/api.maplink.global\/toll\/v1\/calculations<\/a> &#8211; <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-orange-color\">POST<\/mark><\/strong><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Trip API + Toll API<\/strong><\/h2>\n\n\n\n<p>The Toll 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 toll 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-orange-color\">POST<\/mark> <br><\/strong>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-orange-color\">POST<\/mark> <br><\/strong>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 will be sent to obtain the values of the tolls on the route. The [&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":[163],"tags":[],"class_list":["post-2613","post","type-post","status-publish","format-standard","hentry","category-toll-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2613","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=2613"}],"version-history":[{"count":2,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2613\/revisions"}],"predecessor-version":[{"id":3219,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2613\/revisions\/3219"}],"wp:attachment":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/media?parent=2613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/categories?post=2613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/tags?post=2613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}