{"_id":"5a305118c8392b0032f6ae17","category":{"_id":"5a305118c8392b0032f6ae09","version":"5a305118c8392b0032f6ae07","project":"5425e663ffd4411c319a65b4","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-09-29T20:18:57.785Z","from_sync":false,"order":1,"slug":"reference","title":"Reference"},"project":"5425e663ffd4411c319a65b4","user":"5425e31affd4411c319a65b1","version":{"_id":"5a305118c8392b0032f6ae07","project":"5425e663ffd4411c319a65b4","__v":1,"createdAt":"2017-12-12T21:58:48.080Z","releaseDate":"2017-12-12T21:58:48.080Z","categories":["5a305118c8392b0032f6ae08","5a305118c8392b0032f6ae09"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.6.0","version":"2.6"},"__v":0,"parentDoc":null,"updates":["556e5731d02e0b190042f214","568fa4b0b700ce0d002f4ad9"],"next":{"pages":[],"description":""},"createdAt":"2014-09-30T21:35:39.373Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"never","params":[],"url":""},"isReference":false,"order":5,"body":"Destinations represent the location details for tasks, including exact coordinate and address information.\n[block:api-header]\n{\n \"type\": \"post\",\n \"title\": \"Create destination\"\n}\n[/block]\nBody parameters\n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Name\",\n \"h-1\": \"Type\",\n \"h-2\": \"Description\",\n \"0-0\": \"address\",\n \"0-1\": \"object\",\n \"0-2\": \"The destination’s street address details.\",\n \"1-0\": \"location\",\n \"1-1\": \"array\",\n \"1-2\": \"Optional. The ```[ longitude, latitude ]``` geographic coordinates. If missing, the API will geocode based on the address details provided. Note that geocoding may slightly modify the format of the ```address``` properties. ```address.unparsed``` cannot be provided if you are also including a `location`.\"\n },\n \"cols\": 3,\n \"rows\": 2\n}\n[/block]\nAn ```address``` has the following properties:\n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Name\",\n \"h-1\": \"Type\",\n \"h-2\": \"Description\",\n \"0-0\": \"name\",\n \"0-1\": \"string\",\n \"0-2\": \"Optional. A name associated with this address, for example, *\\\"Transamerica Pyramid\\\"*.\",\n \"1-0\": \"number\",\n \"1-1\": \"string\",\n \"1-2\": \"The number component of this address, it may also contain letters.\",\n \"2-0\": \"street\",\n \"2-1\": \"string\",\n \"2-2\": \"The name of the street.\",\n \"3-0\": \"apartment\",\n \"3-1\": \"string\",\n \"3-2\": \"Optional. The suite or apartment number, or any additional relevant information.\",\n \"4-0\": \"city\",\n \"4-1\": \"string\",\n \"4-2\": \"The name of the municipality.\",\n \"5-0\": \"state\",\n \"5-1\": \"string\",\n \"5-2\": \"Optional. The name of the state, province or jurisdiction.\",\n \"6-0\": \"postalCode\",\n \"6-1\": \"string\",\n \"6-2\": \"Optional. The postal or zip code.\",\n \"7-0\": \"country\",\n \"7-1\": \"string\",\n \"7-2\": \"The name of the country.\",\n \"8-0\": \"unparsed\",\n \"8-1\": \"string\",\n \"8-2\": \"Optional. A complete address specified in a single, unparsed string where the various elements are separated by commas. If present, all other address properties will be ignored (with the exception of ```name``` and ```apartment```). In some countries, you may skip most address details (like ```city``` or ```state```) if you provide a valid ```postalCode```: for example, ```543 Howard St, 94105, USA``` will be geocoded correctly.\"\n },\n \"cols\": 3,\n \"rows\": 9\n}\n[/block]\nCreate destination with complete `address` details:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"$ curl -X POST \\\"https://onfleet.com/api/v2/destinations\\\" \\\\\\n -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\" \\\\\\n -d '{\\\"address\\\":{\\\"number\\\":\\\"543\\\",\\\"street\\\":\\\"Howard St\\\",\\\"apartment\\\":\\\"5th Floor\\\",\\\"city\\\":\\\"San Francisco\\\",\\\"state\\\":\\\"CA\\\",\\\"country\\\":\\\"USA\\\"},\\\"notes\\\":\\\"Don\\\\'t forget to check out the epic rooftop.\\\"}'\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\n\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"{\\n \\\"id\\\": \\\"JLn6ZoYGZWn2wB2HaR9glsqB\\\",\\n \\\"timeCreated\\\": 1455156663000,\\n \\\"timeLastModified\\\": 1455156663896,\\n \\\"location\\\": [\\n -122.3965731,\\n 37.7875728\\n ],\\n \\\"address\\\": {\\n \\\"apartment\\\": \\\"5th Floor\\\",\\n \\\"state\\\": \\\"California\\\",\\n \\\"postalCode\\\": \\\"94105\\\",\\n \\\"country\\\": \\\"United States\\\",\\n \\\"city\\\": \\\"San Francisco\\\",\\n \\\"street\\\": \\\"Howard Street\\\",\\n \\\"number\\\": \\\"543\\\"\\n },\\n \\\"notes\\\": \\\"Don't forget to check out the epic rooftop.\\\",\\n \\\"metadata\\\": []\\n}\",\n \"language\": \"json\"\n }\n ]\n}\n[/block]\nCreate destination using an `unparsed` address:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"$ curl -X POST \\\"https://onfleet.com/api/v2/destinations\\\" \\\\\\n -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\" \\\\\\n -d '{\\\"address\\\":{\\\"unparsed\\\":\\\"666 Post St, SF, CA, USA\\\"}}'\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\n\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"{\\n \\\"id\\\": \\\"barP8D82zGyzd~7~74dSCDV1\\\",\\n \\\"timeCreated\\\": 1455156664000,\\n \\\"timeLastModified\\\": 1455156664297,\\n \\\"location\\\": [\\n -122.4128901,\\n 37.787933\\n ],\\n \\\"address\\\": {\\n \\\"apartment\\\": \\\"\\\",\\n \\\"state\\\": \\\"California\\\",\\n \\\"postalCode\\\": \\\"94109\\\",\\n \\\"country\\\": \\\"United States\\\",\\n \\\"city\\\": \\\"San Francisco\\\",\\n \\\"street\\\": \\\"Post Street\\\",\\n \\\"number\\\": \\\"666\\\"\\n },\\n \\\"notes\\\": \\\"\\\",\\n \\\"metadata\\\": []\\n}\",\n \"language\": \"json\"\n }\n ]\n}\n[/block]\n\n[block:api-header]\n{\n \"type\": \"get\",\n \"title\": \"Get single destination\"\n}\n[/block]\n\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"$ curl -X GET \\\"https://onfleet.com/api/v2/destinations/0i~RR0SUIculbRFsIse6MENg\\\" \\\\\\n -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\"\",\n \"language\": \"shell\"\n }\n ]\n}\n[/block]\n\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"{\\n \\\"id\\\": \\\"0i~RR0SUIculbRFsIse6MENg\\\",\\n \\\"timeCreated\\\": 1455156664000,\\n \\\"timeLastModified\\\": 1455156664697,\\n \\\"location\\\": [\\n -122.4052935,\\n 37.7721234\\n ],\\n \\\"address\\\": {\\n \\\"apartment\\\": \\\"\\\",\\n \\\"state\\\": \\\"California\\\",\\n \\\"postalCode\\\": \\\"94103\\\",\\n \\\"country\\\": \\\"United States\\\",\\n \\\"city\\\": \\\"San Francisco\\\",\\n \\\"street\\\": \\\"Brannan Street\\\",\\n \\\"number\\\": \\\"888\\\"\\n },\\n \\\"notes\\\": \\\"\\\",\\n \\\"metadata\\\": []\\n}\",\n \"language\": \"json\"\n }\n ]\n}\n[/block]","excerpt":"","slug":"destinations","type":"basic","title":"Destinations"}