{"info":{"_postman_id":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","name":"Oauth API","description":"<html><head></head><body><h1 id=\"list-of-api-requests-that-are-available-through-syncontrol-platform\">List of API requests that are available through Syncontrol platform</h1>\n<h2 id=\"authorization\">Authorization</h2>\n<p>To perform a request you'll need to provide a Bearer token header: <a href=\"https://learning.postman.com/docs/sending-requests/authorization/#bearer-token\">https://learning.postman.com/docs/sending-requests/authorization/#bearer-token</a></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"List of API requests that are available through Syncontrol platform","slug":"list-of-api-requests-that-are-available-through-syncontrol-platform"}],"owner":"12879423","collectionId":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","publishedId":"TVKHTuod","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2020-09-26T09:26:42.000Z"},"item":[{"name":"Bookings","item":[{"name":"List","id":"31dbc166-1183-4c2a-877c-32229165ab4a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"url":"{{Hostname}}/api/bookings","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{Bearer Token}}"}],"advancedConfig":[{"key":"password","value":"{{Bearer Token}}"}]},"isInherited":true,"source":{"_postman_id":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","id":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","name":"Oauth API","type":"collection"}},"urlObject":{"path":["api","bookings"],"host":["{{Hostname}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"31dbc166-1183-4c2a-877c-32229165ab4a"}],"id":"856b82d9-df28-4225-883d-9f70a05bcdee","_postman_id":"856b82d9-df28-4225-883d-9f70a05bcdee","description":"","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{Bearer Token}}"}],"advancedConfig":[{"key":"password","value":"{{Bearer Token}}"}]},"isInherited":true,"source":{"_postman_id":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","id":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","name":"Oauth API","type":"collection"}}},{"name":"Exim","item":[{"name":"List import definitions","id":"bf9d28b0-03c3-4f6c-8359-6cc1cff172ef","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"url":"{{Hostname}}/api/exim/import?","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{Bearer Token}}"}],"advancedConfig":[{"key":"password","value":"{{Bearer Token}}"}]},"isInherited":true,"source":{"_postman_id":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","id":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","name":"Oauth API","type":"collection"}},"urlObject":{"path":["api","exim","import"],"host":["{{Hostname}}"],"query":[{"key":"","value":null}],"variable":[]}},"response":[],"_postman_id":"bf9d28b0-03c3-4f6c-8359-6cc1cff172ef"},{"name":"List export definitions","id":"3537f1d1-de6a-43b3-aee0-f5446e6ca617","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/vnd.api+json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"url":"{{Hostname}}/api/exim/export","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{Bearer Token}}"}],"advancedConfig":[{"key":"password","value":"{{Bearer Token}}"}]},"isInherited":true,"source":{"_postman_id":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","id":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","name":"Oauth API","type":"collection"}},"urlObject":{"path":["api","exim","export"],"host":["{{Hostname}}"],"query":[{"disabled":true,"key":"","value":null}],"variable":[]}},"response":[],"_postman_id":"3537f1d1-de6a-43b3-aee0-f5446e6ca617"},{"name":"Request export","id":"9e7c53f3-723d-4382-8e5e-a079dd35710d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"url":"{{Hostname}}/api/exim/export?path=&from=&to=&format=","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{Bearer Token}}"}],"advancedConfig":[{"key":"password","value":"{{Bearer Token}}"}]},"isInherited":true,"source":{"_postman_id":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","id":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","name":"Oauth API","type":"collection"}},"urlObject":{"path":["api","exim","export"],"host":["{{Hostname}}"],"query":[{"description":{"content":"<p>[Required] {string} Path to the defintion</p>\n","type":"text/plain"},"key":"path","value":""},{"description":{"content":"<p>[Required] {YYYY-MM-DD} Date from which to include results</p>\n","type":"text/plain"},"key":"from","value":""},{"description":{"content":"<p>[Required] {YYYY-MM-DD} Date to which to include results</p>\n","type":"text/plain"},"key":"to","value":""},{"description":{"content":"<p>[Required] {\"xml\"/\"json\"/\"xls\"} Format to return the data</p>\n","type":"text/plain"},"key":"format","value":""}],"variable":[]}},"response":[{"id":"ccb5f66c-2a22-428a-bfd3-3f3f607ea643","name":"Booking export","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"url":{"raw":"{{Hostname}}/api/exim/export?path=all/ExportPresets/Bookings&from=2020-01-01&to=2021-01-01&format=json","host":["{{Hostname}}"],"path":["api","exim","export"],"query":[{"key":"path","value":"all/ExportPresets/Bookings","description":"[Required] {string} Path to the defintion"},{"key":"from","value":"2020-01-01","description":"[Required] {YYYY-MM-DD} Date from which to include results"},{"key":"to","value":"2021-01-01","description":"[Required] {YYYY-MM-DD} Date to which to include results"},{"key":"format","value":"json","description":"[Required] {\"xml\"/\"json\"/\"xls\"} Format to return the data"}]}},"code":200,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"[\r\n{\r\n\"Service number\": \"XXXXXXXXX\",\r\n}\r\n]"}],"_postman_id":"9e7c53f3-723d-4382-8e5e-a079dd35710d"},{"name":"Start import","id":"a6c329a3-91f0-4413-8406-f5d6b9491921","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","type":"text","value":"application/json"},{"key":"Accept","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"[\r\n\r\n]"},"url":"{{Hostname}}/api/exim/import?path=","description":"<p>Put the import job on the queue.\nThe job will be run async. You can get the job status by calling corresponding API.</p>\n<p>The body should be an array of arrays with data following the import structure or excel example.\nThe structure is <code>Row&lt;Column[]&gt;</code></p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{Bearer Token}}"}],"advancedConfig":[{"key":"password","value":"{{Bearer Token}}"}]},"isInherited":true,"source":{"_postman_id":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","id":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","name":"Oauth API","type":"collection"}},"urlObject":{"path":["api","exim","import"],"host":["{{Hostname}}"],"query":[{"description":{"content":"<p>[Required] {string} Path to the defintion</p>\n","type":"text/plain"},"key":"path","value":""}],"variable":[]}},"response":[{"id":"6373da4d-ecdd-480c-b816-396fee0eb469","name":"Booking Import Example","originalRequest":{"method":"POST","header":[{"key":"Content-Type","type":"text","value":"application/json"},{"key":"Accept","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"[\r\n    {\r\n        \"bookings\": {\r\n            \"desired_start_date\": \"2020-01-01 00:00:00\",\r\n            \"desired_end_date\": \"2020-01-01 00:00:00\",\r\n            \"planned_shipment_date\": \"2020-01-01 00:00:00\",\r\n            \"service_type\": \"FRI\",\r\n            \"notes\": \"Test booking imported\"\r\n        },\r\n        \"products\": {\r\n            \"booking_props\": {\r\n                \"order_reference\": \"TEST\"\r\n            },\r\n            \"unique_internal_id\": \"123\",\r\n            \"product_name\": \"Test product\",\r\n            \"booking_products\": {\r\n                \"number_of_pieces\": 1000\r\n            }\r\n        },\r\n        \"suppliers\": {\r\n            \"internal_id\": \"S001\",\r\n            \"name\": \"Test supplier\"\r\n        }\r\n    }\r\n]"},"url":{"raw":"{{Hostname}}/api/exim/import?path=sofeast-booking.com/ImportPresets/ClientBookings","host":["{{Hostname}}"],"path":["api","exim","import"],"query":[{"key":"path","value":"sofeast-booking.com/ImportPresets/ClientBookings","description":"[Required] {string} Path to the defintion"}]}},"status":"OK","code":200,"_postman_previewlanguage":"html","header":[{"key":"Server","value":"nginx/1.19.2"},{"key":"Date","value":"Tue, 03 Nov 2020 18:38:12 GMT"},{"key":"Content-Type","value":"text/html; charset=UTF-8"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept-Encoding"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"X-RateLimit-Limit","value":"60"},{"key":"X-RateLimit-Remaining","value":"58"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"Content-Encoding","value":"gzip"}],"cookie":[],"responseTime":null,"body":"374467"}],"_postman_id":"a6c329a3-91f0-4413-8406-f5d6b9491921"},{"name":"Get import status","id":"8e352259-8a25-4b7c-93bc-2fbb97227e1b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","type":"text","value":"application/json"},{"key":"Accept","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"[\r\n    [\r\n        \r\n    ]\r\n]"},"url":"{{Hostname}}/api/exim/import/{{job_id}}","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{Bearer Token}}"}],"advancedConfig":[{"key":"password","value":"{{Bearer Token}}"}]},"isInherited":true,"source":{"_postman_id":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","id":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","name":"Oauth API","type":"collection"}},"urlObject":{"path":["api","exim","import","{{job_id}}"],"host":["{{Hostname}}"],"query":[],"variable":[]}},"response":[{"id":"7dd11b7b-7db4-457b-86fe-1d9e3779a358","name":"Get import status","originalRequest":{"method":"GET","header":[{"key":"Content-Type","type":"text","value":"application/json"},{"key":"Accept","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"[\r\n    [\r\n        \r\n    ]\r\n]"},"url":"{{Hostname}}/api/exim/import/1234"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx"},{"key":"Content-Type","value":"application/json"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept-Encoding"},{"key":"X-Powered-By","value":"PHP/7.4.11"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Date","value":"Tue, 06 Oct 2020 17:41:13 GMT"},{"key":"X-RateLimit-Limit","value":"60"},{"key":"X-RateLimit-Remaining","value":"59"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"Content-Encoding","value":"gzip"}],"cookie":[],"responseTime":null,"body":"{\n    \"file\": {\n        \"file_id\": 1,\n        \"subfolder\": \"files\"\n    },\n    \"job\": [\n        {\n            \"file_id\": 2,\n            \"subfolder\": \"import\",\n            \"contents\": [\n                [\n                    {\n                        \"model\": \"Supplier\",\n                        \"id\": 1,\n                        \"result\": true,\n                        \"error\": null\n                    },\n                    {\n                        \"model\": \"Factory\",\n                        \"id\": 1,\n                        \"result\": true,\n                        \"error\": null\n                    }\n                ]\n            ]\n        },\n        {\n            \"file_id\": 3,\n            \"subfolder\": \"parse\",\n            \"contents\": [\n                {\n                    \"suppliers\": {\n                        \"name\": \"Supplier A\",\n                        \"internal_id\": 104357,\n                        \"country\": \"Thailand\",\n                        \"province\": \"Nakhonpathom\",\n                        \"city\": \"Sampran\",\n                        \"website\": \"www.supplier.com\",\n                        \"english_address\": \"Street 1, Bangkok, THAILAND\",\n                        \"local_address\": \"local address\",\n                        \"extra_information\": \"extra information\",\n                        \"contacts\": {\n                            \"contact_first_name\": \"Ms. Test\",\n                            \"contact_last_name\": \"Person\",\n                            \"contact_email\": \"marketing@mail.com\",\n                            \"contact_phone_1\": \"+12345678\",\n                            \"contact_phone_2\": \"+8654311\"\n                        },\n                        \"clients_to_manage\": [\n                            {\n                                \"model\": \"Client\",\n                                \"value\": \"NONE\",\n                                \"id\": 1\n                            }\n                        ]\n                    },\n                    \"factories\": {\n                        \"name\": \"Factory A\",\n                        \"internal_id\": 104357,\n                        \"country\": \"Thailand\",\n                        \"province\": \"Nakhonpathom\",\n                        \"city\": \"Sampran\",\n                        \"website\": \"www.factory.com\",\n                        \"english_address\": \"Street 1, Bangkok, THAILAND\",\n                        \"local_address\": \"local address factory\",\n                        \"extra_information\": \"None\",\n                        \"contacts\": {\n                            \"contact_first_name\": \"Ms. Test\",\n                            \"contact_last_name\": \"Last name\",\n                            \"contact_email\": \"factory@mail.com\",\n                            \"contact_phone_1\": \"+123456\",\n                            \"contact_phone_2\": \"+6543321\"\n                        }\n                    },\n                    \"__validation\": null\n                }\n            ]\n        },\n        {\n            \"subfolder\": \"transform\",\n            \"contents\": [\n                {\n                    \"suppliers\": [\n                        {\n                            \"name\": \"Supplier A\",\n                            \"internal_id\": 104357,\n                            \"country\": \"Thailand\",\n                            \"province\": \"Nakhonpathom\",\n                            \"city\": \"Sampran\",\n                            \"website\": \"www.supplier.com\",\n                            \"english_address\": \"Street 1, Bangkok, THAILAND\",\n                            \"local_address\": \"local address\",\n                            \"extra_information\": \"extra information\",\n                            \"contacts\": {\n                                \"contact_first_name\": \"Ms. Test\",\n                                \"contact_last_name\": \"Person\",\n                                \"contact_email\": \"marketing@mail.com\",\n                                \"contact_phone_1\": \"+12345678\",\n                                \"contact_phone_2\": \"+8654311\"\n                            },\n                            \"clients_to_manage\": [\n                                {\n                                    \"model\": \"Client\",\n                                    \"value\": \"NONE\",\n                                    \"id\": 1\n                                }\n                            ]\n                        }\n                    ],\n                    \"factories\": [\n                        {\n                            \"name\": \"Factory A\",\n                            \"internal_id\": 104357,\n                            \"country\": \"Thailand\",\n                            \"province\": \"Nakhonpathom\",\n                            \"city\": \"Sampran\",\n                            \"website\": \"www.factory.com\",\n                            \"english_address\": \"Street 1, Bangkok, THAILAND\",\n                            \"local_address\": \"local address factory\",\n                            \"extra_information\": \"None\",\n                            \"contacts\": {\n                                \"contact_first_name\": \"Ms. Test\",\n                                \"contact_last_name\": \"Last name\",\n                                \"contact_email\": \"factory@mail.com\",\n                                \"contact_phone_1\": \"+123456\",\n                                \"contact_phone_2\": \"+6543321\"\n                            }\n                        }\n                    ]\n                }\n            ]\n        }\n    ],\n    \"definition\": {\n        \"name\": \"SuppliersAndFactories\",\n        \"limitPerJob\": 10000,\n        \"sheets\": [\n        ]\n    }\n}"}],"_postman_id":"8e352259-8a25-4b7c-93bc-2fbb97227e1b"}],"id":"59a9f531-0898-4f1b-a69f-65092eec484c","description":"<p>Import/Export tasks for data exchange</p>\n<h3 id=\"concepts\">Concepts</h3>\n<p>There are no \"standard\" endpoints in their meaning exposed to third parties by default.\nInstead, we \"enable\" some certain import or export functionality based on customer request. We call it \"import definitions\" and \"export definitions\".\nSuch definition is usually identified by <code>path</code> and its purpose is to translate the data from/to platform to/from 3rd-party service.</p>\n<p>For example, if your ERP is able to upload data in format:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{ \n    data: \"01/03/2020\",\n    id: 123,\n}\n</code></pre><p>our import script can digest this data and transfer to our internal structure, for example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    desired_start_date: \"2020-03-01 00:00:00\",\n    booking_uuid: \"123\",\n}\n</code></pre><h3 id=\"import-workflow\">Import workflow</h3>\n<ol>\n<li>Get a list of import defintions (<code>List Import Definitions</code> endpoint). Copy <code>path</code> attribtue for one that you are interested to use.</li>\n<li>Call <code>Start Import</code> to upload the data. In response, you'll get a number which represents an <code>import id</code>. Import is an asynchronous process and might take some time (up to 10 minutes or more depending on the data).</li>\n<li>You can query for status of the import process by calling <code>Get Import STatus</code> endpoint.</li>\n</ol>\n<h3 id=\"export-workflow\">Export workflow</h3>\n<ol>\n<li>Get a list of export defintions (<code>List Export Definitions</code> endpoint). Copy <code>path</code> attribtue for one that you are interested to use.</li>\n<li>Call <code>Request Export</code> endpoint to request the data. This is synchronous endpoint and the data will be returned immediately in the format that you've requested.</li>\n</ol>\n","event":[{"listen":"prerequest","script":{"id":"5dcf9b6a-c2ee-4279-b230-a9590286cc26","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"fe1152e6-9db7-4673-af83-95ee17176346","type":"text/javascript","exec":[""]}}],"_postman_id":"59a9f531-0898-4f1b-a69f-65092eec484c","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{Bearer Token}}"}],"advancedConfig":[{"key":"password","value":"{{Bearer Token}}"}]},"isInherited":true,"source":{"_postman_id":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","id":"e993247e-8cc0-40c1-a5b0-1b250a8b3cc2","name":"Oauth API","type":"collection"}}}],"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{Bearer Token}}"}],"advancedConfig":[{"key":"password","value":"{{Bearer Token}}"}]}},"event":[{"listen":"prerequest","script":{"id":"5ae3a258-c4e0-4a92-8bdc-1c870a25a7e1","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"7c01b0a8-3551-44ca-8298-9aab8a98502c","type":"text/javascript","exec":[""]}}]}