{"info":{"_postman_id":"ab64b044-6a76-47dc-972f-b1591b5fc3ae","name":"TMH-API","description":"<html><head></head><body><p>Documentation\n<br></p>\n<h3>Authentication</h3>\n\n<p>TMH API can only be accessed over an encrypted connection (HTTPS).\nTMH requires authentication to access the resources. In each request, header x-api-key should have a value provided by TMH.</p>\n<div class=\"column\"><div class=\"page\"><div class=\"layoutArea\"><div class=\"column\"><h2 id=\"Errorhandling-HTTPerrorcodes\">HTTP error codes</h2><p>The error codes listed in the following table may be returned by an operation on any of the Fleet API services. Error codes not part of the list will not be returned.</p><p><br></p></div></div></div><div class=\"table-wrap\"><table><thead><tr><th><div class=\"tablesorter-header-inner\"><div class=\"layoutArea\"><div class=\"column\"><p>Code</p></div></div></div></th><th><div class=\"tablesorter-header-inner\">Reason</div></th><th><div class=\"tablesorter-header-inner\"><p>http errors description</p></div></th></tr></thead><tbody><tr><td><div class=\"layoutArea\"><div class=\"column\"><p>400&nbsp;</p></div></div></td><td>Bad Request</td><td><div class=\"layoutArea\"><div class=\"column\"><p>A required HTTP header was not specified. </p></div></div></td></tr><tr><td><div class=\"layoutArea\"><div class=\"column\"><p>400&nbsp;</p></div></div></td><td>Bad Request</td><td><div class=\"layoutArea\"><div class=\"column\"><p>A required query parameter was not specified for this request. </p></div></div></td></tr><tr><td><div class=\"layoutArea\"><div class=\"column\"><p>400&nbsp;</p></div></div></td><td>Bad Request</td><td><div class=\"layoutArea\"><div class=\"column\"><p>An invalid value was specified for one of the query parameters in the request URI. </p></div></div></td></tr><tr><td><div class=\"layoutArea\"><div class=\"column\"><p>400&nbsp;</p></div></div></td><td>Bad Request</td><td><div class=\"layoutArea\"><div class=\"column\"><p>The url in the request could not be parsed. </p></div></div></td></tr><tr><td><div class=\"layoutArea\"><div class=\"column\"><p>401&nbsp;</p></div></div></td><td>Unauthorized</td><td><div class=\"layoutArea\"><div class=\"column\"><p>The request requires user authentication. </p></div></div></td></tr><tr><td><div class=\"layoutArea\"><div class=\"column\"><p>403</p></div></div></td><td> Forbidden</td><td><div class=\"layoutArea\"><div class=\"column\"><p>Access to the specified resource (Forbidden) has been forbidden. </p></div></div></td></tr><tr><td><div class=\"layoutArea\"><div class=\"column\"><p>404&nbsp;</p></div></div></td><td>Not Found</td><td><div class=\"layoutArea\"><div class=\"column\"><p>The requested resource does not exist. </p></div></div></td></tr><tr><td><div class=\"layoutArea\"><div class=\"column\"><p>500&nbsp;&nbsp;</p></div></div></td><td>Internal Server Error</td><td><div class=\"layoutArea\"><div class=\"column\"><p>The server encountered an internal error. </p></div></div></td></tr><tr><td><div class=\"layoutArea\"><div class=\"column\"><p>502&nbsp;</p></div></div></td><td>Bad Gateway</td><td><div class=\"layoutArea\"><div class=\"column\"><p>The server received an invalid response from an upstream server. </p></div></div></td></tr><tr><td><div class=\"layoutArea\"><div class=\"column\"><p>503&nbsp;&nbsp;</p></div></div></td><td>Service Unavailable</td><td><div class=\"layoutArea\"><div class=\"column\"><p>The server is currently unable to receive requests. Please retry your request. </p></div></div></td></tr><tr><td><div class=\"layoutArea\"><div class=\"column\"><p>504&nbsp;</p></div></div></td><td>Gateway Timeout </td><td><div class=\"layoutArea\"><div class=\"column\"><p>The server did not receive a timely response from an upstream server </p></div></div></td></tr></tbody></table></div></div></body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"4590429","collectionId":"ab64b044-6a76-47dc-972f-b1591b5fc3ae","publishedId":"S1LzwS6o","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2019-05-14T14:25:10.000Z"},"item":[{"name":"Set time and preconditioning","id":"18b8c9cd-b884-49f7-b366-a76ba4cc6fe0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PATCH","header":[{"key":"Content-Type","value":"application/json"},{"key":"x-api-key","type":"text","value":"{{secretapikey}}"}],"body":{"mode":"raw","raw":"{\n  \"schedules\": [\n   {\n      \"departure_time\": \"09:00:00\", \n      \"energy_demand_next_route_wh\": 20000,\n      \"weekdays\": [1], \n      \"arrival_time\": \"12:02:00\",\n      \"preconditioning\": { \n      \t\"active\": \"true\",\n      \t\"time_seconds\": 4500, \n      \t\"energy_demand_wh\": 70000,\n      \t\"type\": 1\n      }\n    },\n    {\n      \"departure_time\": \"08:00:00\",\n      \"target_soc_percentage\": 10,\n      \"weekdays\": [3,4]\n    }\n  ]}"},"url":"{{url}}/api/v1/evs/{{vin}}/schedules","description":"<p>\nPurpose of this endpoint: set departure time and preconditioning settings of a vehicle.\n\n</p><p>It is not possible to update only one specific schedule. TMH is always replacing whole schedules object for specific ev. </p>\n<p><b>Example:</b></p>\n<p>You added 2 schedules for monday and friday. After some time, you decide to change departure_time for monday schedule. TMH expects to receive all schedules again of this specific EV. If TMH will receive only monday schedule, all the other schedules will be deleted. </p>\n<p><b>How to delete schedules?</b></p>\n<p>An empty schedule object is required in order to remove all schedules of a specific EV.</p>\n<code>\n{\n    schedules:[]\n}\n</code>\n<p></p>\n\n<p><b>Attention</b>\nIt is only allowed to either provide target_soc_percentage OR energy_demand_next_route_wh. If both parameter are provided, request is rejected.</p>\n","urlObject":{"path":["api","v1","evs","{{vin}}","schedules"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"3075fff2-a396-4df8-965a-6face93f1f28","name":"Set time and preconditioning","originalRequest":{"method":"PATCH","header":[{"key":"Content-Type","value":"application/json"},{"key":"x-api-key","type":"text","value":"{{secretapikey}}"}],"body":{"mode":"raw","raw":"{\n  \"schedules\": [\n    {\n      \"departure_time\": \"17:00:00\",\n      \"energy_demand_next_route_wh\": 20000, \n      \"weekdays\": [1], \n      \"preconditioning\": { \n      \t\"active\": \"true\",\n      \t\"time_seconds\": 4500,\n      \t\"energy_demand_wh\": 70000 \n      }\n      \n    },\n    {\n      \"departure_time\": \"06:11:00\",\n      \"target_soc_percentage\": 10,\n      \"weekdays\": [3,4],\n      \"preconditioning\": {\n      \t\"active\": \"false\" \n      },\n    {\n      \"departure_time\": \"08:00:00\",\n      \"target_soc_percentage\": 10,\n      \"weekdays\": [3,4],\n      }\n    }\n  ]}"},"url":"{{url}}/api/v1/evs/{{vin}}/schedules"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\n  \"schedules\": [\n    {\n      \"departure_time\": \"17:00:00\",\n      \"energy_demand_next_route_wh\": 20000, \n      \"weekdays\": [1], \n      \"preconditioning\": { \n      \t\"active\": \"true\",\n      \t\"time_seconds\": 4500,\n      \t\"energy_demand_wh\": 70000 \n      \t\"type\": 1\n      }\n      \n    },\n    {\n      \"departure_time\": \"06:11:00\",\n      \"target_soc_percentage\": 10,\n      \"weekdays\": [3,4],\n      \"preconditioning\": {\n      \t\"active\": \"false\" \n      },\n    {\n      \"departure_time\": \"08:00:00\",\n      \"target_soc_percentage\": 10,\n      \"weekdays\": [3,4],\n      }\n    }\n  ]}"}],"_postman_id":"18b8c9cd-b884-49f7-b366-a76ba4cc6fe0"},{"name":"Update ev, set soc","id":"3c44560e-2184-4af6-b3b8-b80cae7b92b8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PATCH","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"},{"key":"x-api-key","type":"text","value":"{{secretapikey}}"}],"body":{"mode":"raw","raw":"{\n    \"soc_percentage\": 30,\n    \"free_energy_capacity_wh\": 20000\n}"},"url":"{{url}}/api/v1/evs/{{vin}}","description":"<p>Purpose of this endpoint: provide EV related details </p>\n<p>Following parameters are allowed in this request:</p>\n<ul>\n<li>\nsoc\n</li>\n<li>\nenergy_state\n</li>\n<li>\nfree_energy_capacity\n</li>\n</ul>\n\n<p><b>Attention</b>\nPlease provide either soc OR energy related parameter.\nIt is not allowed to provide soc AND energy_state, free_energy_capacity within the same request. If all are provided, request will be rejected. </p>\n","urlObject":{"path":["api","v1","evs","{{vin}}"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"b3d9a59d-ae73-4186-baed-407b20e54ae3","name":"Update ev, set soc","originalRequest":{"method":"PATCH","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"energy_state_wh\": 50000,\n    \"free_energy_capacity_wh\": 20000 \n}"},"url":"{{url}}/api/v1/evs/{{vin}}"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\n    \"energy_state_wh\": 50000, \n    \"free_energy_capacity_wh\": 20000 \n}"}],"_postman_id":"3c44560e-2184-4af6-b3b8-b80cae7b92b8"},{"name":"Ping","id":"ed54d94f-f6c7-4764-9f17-b8d2b4c00d5d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{url}}/api/v1/ping","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-api-key"},{"key":"value","value":"{{secretapikey}}"}]},"isInherited":true,"source":{"_postman_id":"ab64b044-6a76-47dc-972f-b1591b5fc3ae","id":"ab64b044-6a76-47dc-972f-b1591b5fc3ae","name":"TMH-API","type":"collection"}},"urlObject":{"path":["api","v1","ping"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"ed54d94f-f6c7-4764-9f17-b8d2b4c00d5d"}],"auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-api-key"},{"key":"value","value":"{{secretapikey}}"}]}},"event":[{"listen":"prerequest","script":{"id":"d8ea221a-fe3b-4ea1-a017-d304e0ebbd1a","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"2126076e-1eb1-4b64-bafb-f57ee9d7d4b5","type":"text/javascript","exec":[""]}}]}