{
  "name": "Planner API",
  "version": "1.0.0",
  "description": "Basic API documentation to communicate with Planner's services",
  "title": "Planner API",
  "url": "https://api.planner-activationcode.dispatchtrack.com",
  "header": {
    "title": "Planner API",
    "content": "<p>Planner's API will allow you to create and obtain information through a RESTful protocol. The lite version of the API will allow you to make 1,000 requests per day without having to pay for the use of the API. In case you need an upgrade please write us to <a href=\"mailto:support@dispatchtrack.com\">support@dispatchtrack.com</a>.</p>\n<p>This page shows in detail the steps needed for integrating with Planner though an HTTP webservice using a <a href=\"http://es.wikipedia.org/wiki/JSON\">JSON</a> format. If you need help please contact us at <a href=\"mailto:support@dispatchtrack.com\">support@dispatchtrack.com</a>.</p>\n<h2>Headers</h2>\n<p>Headers must be set in order to authenticate and link the information to your account. Planner API requires the following headers:</p>\n<ul>\n<li>Authorization: Your API key in order to link all your API activity to your account, this can be created through the web interface in Settings -&gt; ApiKeys. Then encode in base64 your api_key_name with your api_key_secret in the following way api_key_name:api_key_secret</li>\n<li>Content-Type: As seen before, Planner's API is built to work in a JSON data format, so you must specify the request header to be <code>'Content-Type:application/json'</code>.</li>\n</ul>\n<p>Example:</p>\n<pre><code>&quot;Authorization&quot;: &quot;Basic cGxhbm5lcl8wMTp6bXpzV20xWm5ldkpIN21KdVVXRXNXRkVlUGRRU3hjQTZxK3dZeFdtVzJNeFdzTUh3UGZ3cWJoYzRXZURKQmtEa1pSMzNhQVR2NCs5bVAramJGYW1NUWxTTGV3Y2o4djYvY0E9LS1RZk9pUTF3b0ROWXhqUnJFLS1ZdHg5Vnl3TFpzS2d4Lzc5eTdjMXB3PT0=&quot;\n&quot;Content-Type&quot;: &quot;application/json&quot;\n</code></pre>\n<h2>Limits</h2>\n<p>By default, the API has limits to prevent an overload of Planner service. Please design your solution to comply with the following limits:</p>\n<ol>\n<li>1,000 requests per day get method.</li>\n<li>100 requests per day post method.</li>\n<li>100 requests per day put method.</li>\n<li>100 requests per day delete method.</li>\n</ol>\n<h2>Response</h2>\n<ul>\n<li>Headers: After do some action, in all endpoint's response the headers will contain the current number request usage for the resource and action, also show the max request limit</li>\n<li>Unauthorized: When an User try to do some action and he doesn't have the permissions, the response will be Unauthorized with code 401</li>\n<li>Too Many Request: When an User exceeded the limit request in some endpoint, the response will be Exceeded request limit with code 429</li>\n</ul>\n<h2>Filters</h2>\n<p>We accept filters parameters to search and object's group or some specific one. Also, can mix the filters for a more bounded search</p>\n<ul>\n<li>Date Format: Filter support the following date format: Y/m/d, Y-m-d, d/m/Y</li>\n<li>Lower Than: Filter support search by lower than value from some attribute adding <strong>_lt</strong> to the end of attribute name</li>\n<li>Lower Than Equal: Filter support search by lower than equal value from some attribute adding <strong>_lteq</strong> to the end of attribute name</li>\n<li>Greater Than: Filter support search by greater than value from some attribute adding <strong>_gt</strong> to the end of attribute name</li>\n<li>Greater Than Equal: Filter support search by greater than equal value from some attribute adding <strong>_gteq</strong> to the end of attribute name</li>\n</ul>\n<p>Example:</p>\n<pre><code>&quot;filters&quot;: { &quot;created_at&quot;: 2019/12/12 }\n&quot;filters&quot;: { &quot;created_at_lt&quot;: 2019/12/12 }\n&quot;filters&quot;: { &quot;created_at_lteq&quot;: 2019/12/12 }\n&quot;filters&quot;: { &quot;created_at_gt&quot;: 2019/12/12 }\n&quot;filters&quot;: { &quot;created_at_gteq&quot;: 2019/12/12 }\n&quot;filters&quot;: { &quot;created_at_lteq&quot;: 2019/12/12, &quot;created_at_gteq&quot;: 2019/12/10 }\n&quot;filters&quot;: { &quot;created_at_lt&quot;: 2019/12/12, &quot;created_at_gteq&quot;: 2019/12/10 }\n&quot;filters&quot;: { &quot;created_at_lteq&quot;: 2019/12/12, &quot;created_at_gt&quot;: 2019/12/10 }\n</code></pre>\n<h2>Pagination</h2>\n<p>Every Index endpoint is paginated by 30 resources per request. You can set the page and the quantity per page to get in every request, max resources per page is 100.</p>\n<p>Example:</p>\n<pre><code>&quot;page: 3&quot;\n&quot;per_page: 20&quot;\n</code></pre>\n<ul>\n<li>Stop Groups: You can paginate StopGroup's stops passing page and per_page params in Show endpoint.</li>\n</ul>\n<h2>Meta</h2>\n<p>Every Index response have meta information: pages with the total number of elements, pages, current page and resources per page; links with the urls to go first, next, prev and last page for that resource.</p>\n<pre><code>&quot;meta&quot;: {\n &quot;pages&quot;: {\n  &quot;total_pages&quot;: 1,\n  &quot;total_elements&quot;: 2,\n  &quot;current_page&quot;: 1,\n  &quot;objects_per_page&quot;: 30\n },\n &quot;links&quot;: {\n  &quot;first&quot;: &quot;http://test.host/external_api/v1/places?page=1&quot;,\n  &quot;last&quot;: &quot;http://test.host/external_api/v1/places?page=1&quot;,\n  &quot;prev&quot;: &quot;http://test.host/external_api/v1/places?page=1&quot;,\n  &quot;next&quot;: &quot;http://test.host/external_api/v1/places&quot;\n }\n}\n</code></pre>\n<h2>Errors</h2>\n<p>When some resource was unsuccessfully created, the errors will show in the following way:</p>\n<p>Example</p>\n<pre><code>&quot;errors&quot;=&gt;\n [\n  {\n\t &quot;entity&quot;=&gt;&quot;items[1]&quot;,\n\t &quot;name&quot;=&gt;&quot;Item's name can't be blank&quot;\n  }\n ]\n</code></pre>\n<p>Array's number start at 0.</p>\n<p>Failure to comply with these limits may result in denial of services due to a &quot;To Many Requests&quot; error. If you need to increase this limits, please contact <a href=\"mailto:support@dispatchtrack.com\">support@dispatchtrack.com</a>.</p>\n<h1>Webhooks</h1>\n<p>Planner Webhooks are the recommended way of keeping your system up to date with planned routes from Dispatchtrack. In order to add a webhook endpoint, you must register a custom URL into which will be used for all webhooks. Custom headers can also be added. In case you need an upgrade please write us to <a href=\"mailto:support@dispatchtrack.com\">support@dispatchtrack.com</a>. For the wehbook payload, please use the parameters specification on each webhook's section.</p>\n<p>To create and activate webhooks check our <a href=\"https://support.dispatchtrack.com/es/articles/4143332-como-crear-un-webhook\">support center</a></p>\n<h2>Headers</h2>\n<p>Headers must be set in order to authenticate with your services. Example:</p>\n<pre class=\"prettyprint\">{  \"Content-Type\": \"application/json\",  \"X-AUTH-TOKEN\": \"18cf703857db062a72422e5c7134272e\"}\n</code></pre>\n<h2>Plan routes</h2>\n<p>Called when a plan is exported. Endpoint will receive 1 POST request per each route created from the exported plan.</p>\n<pre class=\"prettyprint\">http(s)://custom_url_client/\n</code></pre>\n<p><strong>Example JSON</strong></p>\n<pre class=\"prettyprint\">{\n\t\"plan_id\": 147,\n\t\"route_id\": 1117,\n\t\"account_id\": 3,\n\t\"user_id\": 3,\n\t\"start_date\": \"2020-03-20\",\n\t\"end_date\": \"2020-03-20\",\n\t\"start_time\": 28800,\n\t\"end_time\": 61159,\n\t\"vehicle\": {\n\t\t\"identifier\": \"ABC-001\"\n\t},\n\t\"stops\": [{\n\t\t\"stop_group_id\": 180,\n\t\t\"stop_id\": 26971,\n\t\t\"identifier\": \"5351907335\",\n\t\t\"latitude\": -33.42341,\n\t\t\"longitude\": -70.64042,\n\t\t\"address\": \"Test avenue 854\",\n\t\t\"arrival_time\": 30720,\n\t\t\"driving_period\": 1920,\n\t\t\"service_time\": 600,\n\t\t\"delivery_times\": [{\n\t\t\t\"min_delivery_time\": \"2020-03-20 11:00:00 UTC\",\n\t\t\t\"max_delivery_time\": \"2020-03-20 20:00:00 UTC\"\n\t\t}]\n\t}]\n}\n</code></pre>\n<p><strong>Field Description</strong></p>\n<p><strong>1. Route attributes</strong></p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align:left\">Field</th>\n<th style=\"text-align:center\">Type</th>\n<th style=\"text-align:right\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\">plan_id</td>\n<td style=\"text-align:center\">Integer</td>\n<td style=\"text-align:right\">Plan unique ID</td>\n</tr>\n<tr>\n<td style=\"text-align:left\">route_id</td>\n<td style=\"text-align:center\">Integer</td>\n<td style=\"text-align:right\">Route unique ID</td>\n</tr>\n<tr>\n<td style=\"text-align:left\">account_id</td>\n<td style=\"text-align:center\">Integer</td>\n<td style=\"text-align:right\">Dispatchtrack's account unique ID</td>\n</tr>\n<tr>\n<td style=\"text-align:left\">user_id</td>\n<td style=\"text-align:center\">Integer</td>\n<td style=\"text-align:right\">User who exports plan unique ID</td>\n</tr>\n<tr>\n<td style=\"text-align:left\">start_date</td>\n<td style=\"text-align:center\">String</td>\n<td style=\"text-align:right\">Date with format ISO8601 Y-M-D</td>\n</tr>\n<tr>\n<td style=\"text-align:left\">end_date</td>\n<td style=\"text-align:center\">String</td>\n<td style=\"text-align:right\">Date with format ISO8601 Y-M-D</td>\n</tr>\n<tr>\n<td style=\"text-align:left\">start_time</td>\n<td style=\"text-align:center\">Integer</td>\n<td style=\"text-align:right\">Route start time in seconds since beginning of day</td>\n</tr>\n<tr>\n<td style=\"text-align:left\">end_time</td>\n<td style=\"text-align:center\">Integer</td>\n<td style=\"text-align:right\">Route end time in seconds since beginning of day</td>\n</tr>\n</tbody>\n</table>\n<p><strong>2. Vehicle attributes</strong></p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align:left\">Field</th>\n<th style=\"text-align:center\">Type</th>\n<th style=\"text-align:right\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\">identifier</td>\n<td style=\"text-align:center\">String</td>\n<td style=\"text-align:right\">Vehicle identifier</td>\n</tr>\n</tbody>\n</table>\n<p><strong>3. Stops attributes</strong></p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align:left\">Field</th>\n<th style=\"text-align:center\">Type</th>\n<th style=\"text-align:right\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\">stop_group_id</td>\n<td style=\"text-align:center\">Integer</td>\n<td style=\"text-align:right\">Stop group identifier</td>\n</tr>\n<tr>\n<td style=\"text-align:left\">stop_id</td>\n<td style=\"text-align:center\">Integer</td>\n<td style=\"text-align:right\">Stop unique ID</td>\n</tr>\n<tr>\n<td style=\"text-align:left\">identifier</td>\n<td style=\"text-align:center\">String</td>\n<td style=\"text-align:right\">Stop identifier</td>\n</tr>\n<tr>\n<td style=\"text-align:left\">latitude</td>\n<td style=\"text-align:center\">Float</td>\n<td style=\"text-align:right\">Stop latitude</td>\n</tr>\n<tr>\n<td style=\"text-align:left\">longitude</td>\n<td style=\"text-align:center\">Float</td>\n<td style=\"text-align:right\">Stop longitude</td>\n</tr>\n<tr>\n<td style=\"text-align:left\">address</td>\n<td style=\"text-align:center\">String</td>\n<td style=\"text-align:right\">Stop address</td>\n</tr>\n<tr>\n<td style=\"text-align:left\">arrival_time</td>\n<td style=\"text-align:center\">Integer</td>\n<td style=\"text-align:right\">Stop arrival time in seconds since beginning of day</td>\n</tr>\n<tr>\n<td style=\"text-align:left\">driving_period</td>\n<td style=\"text-align:center\">Integer</td>\n<td style=\"text-align:right\">Driving period to stop in seconds</td>\n</tr>\n<tr>\n<td style=\"text-align:left\">service_time</td>\n<td style=\"text-align:center\">Integer</td>\n<td style=\"text-align:right\">Stop service time in seconds</td>\n</tr>\n</tbody>\n</table>\n<p><strong>3. Delivery times</strong></p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align:left\">Field</th>\n<th style=\"text-align:center\">Type</th>\n<th style=\"text-align:right\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\">min_delivery_time</td>\n<td style=\"text-align:center\">String</td>\n<td style=\"text-align:right\">Date with format ISO8601 Y-M-D H:M:S in UTC</td>\n</tr>\n<tr>\n<td style=\"text-align:left\">max_delivery_time</td>\n<td style=\"text-align:center\">String</td>\n<td style=\"text-align:right\">Date with format ISO8601 Y-M-D H:M:S in UTC</td>\n</tr>\n</tbody>\n</table>\n"
  },
  "order": [
    "Places",
    "Plans",
    "StopGroups",
    "Trucks"
  ],
  "sampleUrl": false,
  "defaultVersion": "0.0.0",
  "apidoc": "0.3.0",
  "generator": {
    "name": "apidoc",
    "time": "2021-12-10T15:27:40.118Z",
    "url": "https://apidocjs.com",
    "version": "0.29.0"
  }
}
