{"id":2482,"date":"2023-12-12T17:24:35","date_gmt":"2023-12-12T17:24:35","guid":{"rendered":"https:\/\/developers.maplink.global\/building-requests-for-the-planning-api\/"},"modified":"2024-02-28T18:07:04","modified_gmt":"2024-02-28T18:07:04","slug":"building-requests-for-the-planning-api","status":"publish","type":"post","link":"https:\/\/developers.maplink.global\/en\/building-requests-for-the-planning-api\/","title":{"rendered":"Building requests for the Planning 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<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<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<p>All the parameters for solving the logistical problem will be sent to the <em>body <\/em>.<\/p>\n\n<p>The Planning API works <strong>asynchronously<\/strong>. In other words, an ID will be returned when the problem is sent. With this ID you can check the response in the future or the processing status.  <\/p>\n\n<p>The API has the following endpoints, where the term <strong>{{planningId}}<\/strong> be replaced by the ID of the problem to be consulted:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/api.maplink.global\/planning\/v1\/problems\">https:\/\/api.maplink.global\/planning\/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><\/strong><br\/>Used to send the logistics problem. An ID will be returned for the query.<br\/><br\/><\/li>\n\n\n\n<li><a href=\"https:\/\/api.maplink.global\/planning\/v1\/events?jobId=%7B%7BplanningId\">https:\/\/api.maplink.global\/planning\/v1\/events?jobId=<strong>{{planningId}}<\/strong><\/a> &#8211; <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">GET<\/mark><\/strong><br\/>Returns all the states from the time the request was received until its completion.<br\/><br\/><\/li>\n\n\n\n<li><a href=\"https:\/\/api.maplink.global\/planning\/v1\/jobs\/%7B%7Bplanningjobid\">https:\/\/api.maplink.global\/planning\/v1\/jobs\/{{planningId}}<\/a> &#8211; <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">GET<\/mark><\/strong><br\/>Returns the current processing status of the request.<br\/><br\/><\/li>\n\n\n\n<li><a href=\"https:\/\/api.maplink.global\/planning\/v1\/solutions\/\">https:\/\/api.maplink.global\/planning\/v1\/solutions\/{{planningId}}<\/a> &#8211; <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">GET<\/mark><\/strong><br\/>Returns the result of logistics planning.<br\/><\/li>\n<\/ul>\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><cite><strong>Note<\/strong>: Solution IDs are available for consultation for a period of <strong>7 days<\/strong>.<\/cite><\/blockquote>\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: All the parameters for solving the logistical problem will be sent to the body . The Planning API works [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[160],"tags":[],"class_list":["post-2482","post","type-post","status-publish","format-standard","hentry","category-planning-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2482","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=2482"}],"version-history":[{"count":5,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2482\/revisions"}],"predecessor-version":[{"id":2536,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2482\/revisions\/2536"}],"wp:attachment":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/media?parent=2482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/categories?post=2482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/tags?post=2482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}