{"id":3043,"date":"2021-07-06T13:33:03","date_gmt":"2021-07-06T11:33:03","guid":{"rendered":"https:\/\/www.trans.eu\/api\/?p=3043"},"modified":"2025-12-29T10:56:38","modified_gmt":"2025-12-29T09:56:38","slug":"add-time-window","status":"publish","type":"post","link":"https:\/\/www.trans.eu\/api\/dock-scheduler\/time-window\/add-time-window\/","title":{"rendered":"Add time window"},"content":{"rendered":"\n<p>This method allows you to add time win\u00addow.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Authorization and access<\/h2>\n\n\n\n<p>Autho\u00adriza\u00adtion process is described&nbsp;<a href=\"https:\/\/www.trans.eu\/api\/general-information\/authorization-process\/\" target=\"_blank\" rel=\"noopener\" title>here<\/a>. Each API request must also con\u00adsist of unique Api-key obtained dur\u00ading appli\u00adca\u00adtion reg\u00adis\u00adtra\u00adtion togeth\u00ader with client_id and client_secret.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Url parameters and connection settings<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>URL:&nbsp;<\/strong>https:\/\/api.platform.trans.eu<\/li>\n\n\n\n<li><strong>End\u00adpoint:<\/strong> \/ex\u00adt\/\u00addock-sched\u00aduler-api\/v1\/ware\u00adhouse\u00ad\/\u00adtimeWin\u00addow<\/li>\n\n\n\n<li><strong>Http Method:<\/strong> POST<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Headers<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Accept: application\/json<\/li>\n\n\n\n<li>Con\u00adtent-type: application\/json<\/li>\n\n\n\n<li>Autho\u00adriza\u00adtion: Bear\u00ader {access_token}<\/li>\n\n\n\n<li>Api-key: {unique_ap\u00adp_api-key}<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Json example for carrier with trans id<\/h2>\n\n\n\n<p>Sam\u00adple Json for cre\u00adat\u00ading time slot using required data only for car\u00adri\u00ader with trans id. <\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>{\n  \"valid_from\": \"2021-06-16\",\n  \"valid_to\": \"2021-06-16\",\n  \"range_type\": \"CYCLE\",\n  \"remarks\": \"Be Carefully\",\n  \"external_number\": \"123xyz\",\n  \"carrier\": {\n    \"id\": 1013865\n  },\n  \"ramp_ids\": [14532,14533],\n  \"route\": {\n    \"spots\": [\n      {\n        \"order\": 1,\n        \"warehouse_id\": 29,\n        \"operations\": [\n          {\n            \"operation_type\": \"LOADING\",\n            \"order\": 1,\n            \"belongs_to_time_window\": true\n          }\n        ]\n      },\n      {\n        \"order\": 2,\n        \"address\": {},\n        \"operations\": [\n          {\n            \"operation_type\": \"UNLOADING\",\n            \"order\": 1,\n            \"belongs_to_time_window\": false\n          }\n        ]\n      }\n    ]\n  }\n}<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Json example for a carrier without trans id (not using the trans.eu platform)<\/h2>\n\n\n\n<p>Sam\u00adple Json for cre\u00adat\u00ading time slot using required data only for car\u00adri\u00ader with\u00adout trans id (the car\u00adri\u00ader does not use the trans.eu plat\u00adform). <\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>{\n  \"valid_from\": \"2021-06-16\",\n  \"valid_to\": \"2021-06-16\",\n  \"range_type\": \"CYCLE\",\n  \"remarks\": \"Be Carefully\",\n  \"external_number\": \"123xyz\",\n  \"carrier\": {\n    \"email\": \"aa@bb.pl\",\n    \"legal_name\": \"Name Surmane\",\n    \"telephone\": \"38 73 592\",\n    \"type\": \"EXTERNAL\"\n  },\n  \"ramp_ids\": [14532,14533],\n  \"route\": {\n    \"spots\": [\n      {\n        \"order\": 1,\n        \"warehouse_id\": 29,\n        \"operations\": [\n          {\n            \"operation_type\": \"LOADING\",\n            \"order\": 1,\n            \"belongs_to_time_window\": true\n          }\n        ]\n      },\n      {\n        \"order\": 2,\n        \"address\": {},\n        \"operations\": [\n          {\n            \"operation_type\": \"UNLOADING\",\n            \"order\": 1,\n            \"belongs_to_time_window\": false\n          }\n        ]\n      }\n    ]\n  }\n}<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Response from the system (the request included TransID)<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>{\n  \"carrier\": {\n    \"id\": 1013865,\n    \"legal_name\": \"Firma Testowa\"\n  },\n  \"created_at\": \"2021-06-16T10:07:55.42358\",\n  \"end_time\": null,\n  \"external_number\": \"123xyz\",\n  \"freight_order\": null,\n  \"id\": 8596,\n  \"operation_type\": \"LOADING\",\n  \"ramps\": [\n        {\n            \"id\": 14532,\n            \"name\": \"Rampa1\",\n            \"operation_type\": \"any\",\n            \"ramp_type\": \"RAMP\"\n        },\n        {\n            \"id\": 14533,\n            \"name\": \"Rampa2\",\n            \"operation_type\": \"any\",\n            \"ramp_type\": \"RAMP\"\n        }\n    ],\n  \"range_type\": \"CYCLE\",\n  \"reference_number\": \"DS\/144461A\",\n  \"route\": {\n    \"spots\": [\n      {\n        \"address\": {\n          \"coordinates\": {\n            \"latitude\": 90,\n            \"longitude\": 999\n          },\n          \"country\": \"pl\",\n          \"locality\": \"Warszawa\",\n          \"name\": \"Magazyn_jeden\",\n          \"number\": \"12\",\n          \"postal_code\": \"00-950\",\n          \"street\": \"Nowa\"\n        },\n        \"operations\": [\n          {\n            \"begin\": null,\n            \"end\": null,\n            \"operation_type\": \"LOADING\",\n            \"order\": 1,\n            \"time_window_id\": 8596\n          }\n        ],\n        \"order\": 1\n      },\n      {\n        \"address\": {\n          \"coordinates\": null,\n          \"country\": null,\n          \"locality\": null,\n          \"name\": null,\n          \"number\": null,\n          \"postal_code\": null,\n          \"street\": null\n        },\n        \"operations\": [\n          {\n            \"begin\": null,\n            \"end\": null,\n            \"operation_type\": \"UNLOADING\",\n            \"order\": 1,\n            \"time_window_id\": null\n          }\n        ],\n        \"order\": 2\n      }\n    ]\n  },\n  \"start_time\": null,\n  \"status\": \"AVAILABLE\",\n  \"valid_from\": \"2021-06-16\",\n  \"valid_to\": \"2021-06-16\",\n  \"warehouse\": {\n    \"id\": 29,\n    \"name\": \"Magazyn_jeden\",\n    \"time_zone\": {\n      \"id\": \"Europe\/Warsaw\",\n      \"offset\": \"+02:00\"\n    }\n  }\n}<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p class=\"dont-break-out\">This method allows you to add time win\u00addow.<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"wp_typography_post_enhancements_disabled":false,"footnotes":""},"categories":[89],"tags":[],"class_list":["post-3043","post","type-post","status-publish","format-standard","hentry","category-time-window"],"acf":[],"aioseo_notices":[],"lang":"en","translations":{"en":3043},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/posts\/3043","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/comments?post=3043"}],"version-history":[{"count":4,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/posts\/3043\/revisions"}],"predecessor-version":[{"id":5506,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/posts\/3043\/revisions\/5506"}],"wp:attachment":[{"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/media?parent=3043"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/categories?post=3043"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/tags?post=3043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}