{"_id":"59778bb932f043002002f5dc","category":{"_id":"59778bb932f043002002f5d5","version":"59778bb932f043002002f5d3","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"},"user":"5425e31affd4411c319a65b1","project":"5425e663ffd4411c319a65b4","version":{"_id":"59778bb932f043002002f5d3","project":"5425e663ffd4411c319a65b4","__v":1,"createdAt":"2017-07-25T18:19:37.272Z","releaseDate":"2017-07-25T18:19:37.272Z","categories":["59778bb932f043002002f5d4","59778bb932f043002002f5d5"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.5.0","version":"2.5"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-09-30T20:44:06.142Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"never","params":[],"url":""},"isReference":false,"order":14,"body":"A recipient is an organization’s customer and a target for a task, that is, whom the task is being delivered to.\n[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"Create recipient\"\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\": \"name\",\n    \"0-1\": \"string\",\n    \"0-2\": \"The recipient’s complete name.\",\n    \"1-0\": \"phone\",\n    \"1-1\": \"string\",\n    \"1-2\": \"A unique, valid phone number as per the recipient’s organization’s ```country```.\",\n    \"2-0\": \"notes\",\n    \"2-1\": \"string\",\n    \"2-2\": \"Optional. Notes for this recipient: these are global notes that should not be task- or destination-specific. For example, *\\\"Customer since June 2012, does not drink non-specialty coffee\\\"*.\",\n    \"3-0\": \"skipSMSNotifications\",\n    \"3-1\": \"boolean\",\n    \"3-2\": \"Optional. Whether this recipient has requested to not receive SMS notifications. Defaults to ```false``` if not provided.\",\n    \"4-0\": \"skipPhoneNumberValidation\",\n    \"4-1\": \"boolean\",\n    \"4-2\": \"Optional. Whether to skip validation of this recipient's  phone number. An E.164-like number is still required (must start with `+`), however the API will not enforce any country-specific validation rules.\"\n  },\n  \"cols\": 3,\n  \"rows\": 5\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -X POST \\\"https://onfleet.com/api/v2/recipients\\\" \\\\\\n       -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\" \\\\\\n       -d '{\\\"name\\\":\\\"Boris Foster\\\",\\\"phone\\\":\\\"650-555-1133\\\",\\\"notes\\\":\\\"Always orders our GSC special\\\"}'\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"VVLx5OdKvw0dRSjT2rGOc6Y*\\\",\\n  \\\"organization\\\": \\\"yAM*fDkztrT3gUcz9mNDgNOL\\\",\\n  \\\"timeCreated\\\": 1455156665000,\\n  \\\"timeLastModified\\\": 1455156665390,\\n  \\\"name\\\": \\\"Boris Foster\\\",\\n  \\\"phone\\\": \\\"+16505551133\\\",\\n  \\\"notes\\\": \\\"Always orders our GSC special\\\",\\n  \\\"skipSMSNotifications\\\": false,\\n  \\\"metadata\\\": []\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"put\",\n  \"title\": \"Update recipient\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -X PUT \\\"https://onfleet.com/api/v2/recipients/VVLx5OdKvw0dRSjT2rGOc6Y*\\\" \\\\\\n       -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\" \\\\\\n       -d '{\\\"name\\\":\\\"Neiman Runtilly\\\"}'\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"VVLx5OdKvw0dRSjT2rGOc6Y*\\\",\\n  \\\"organization\\\": \\\"yAM*fDkztrT3gUcz9mNDgNOL\\\",\\n  \\\"timeCreated\\\": 1455156665000,\\n  \\\"timeLastModified\\\": 1455156665741,\\n  \\\"name\\\": \\\"Neiman Runtilly\\\",\\n  \\\"phone\\\": \\\"+16505551133\\\",\\n  \\\"notes\\\": \\\"Always orders our GSC special\\\",\\n  \\\"skipSMSNotifications\\\": false,\\n  \\\"metadata\\\": []\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"Find recipient\"\n}\n[/block]\nYou can search for recipients by ```name``` or ```phone```. Note that finding a recipient requires that there be an exact match for the target property provided. Names are case insensitive and must be properly encoded, while phones will be automatically E.164-formatted prior to performing the lookup as per your organization's ```country``` setting.\n\nTo find a recipient by name, the endpoint format is ```/name/:name```, for example, ```/name/jony%20chives```. Similarly, to find a recipient by phone, the format is ```/phone/:phone```, for example, ```/phone/4155521837```.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -X GET \\\"https://onfleet.com/api/v2/recipients/name/neiman%20runtilly\\\" \\\\\\n       -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\"\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"7tuqrtwo75UlcJFCzDk7Clfk\\\",\\n  \\\"organization\\\": \\\"yAM*fDkztrT3gUcz9mNDgNOL\\\",\\n  \\\"timeCreated\\\": 1455142309000,\\n  \\\"timeLastModified\\\": 1455142309695,\\n  \\\"name\\\": \\\"Neiman Runtilly\\\",\\n  \\\"phone\\\": \\\"+16503201133\\\",\\n  \\\"notes\\\": \\\"Always orders our GSC special\\\",\\n  \\\"skipSMSNotifications\\\": false,\\n  \\\"metadata\\\": []\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"Get single recipient\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -X GET \\\"https://onfleet.com/api/v2/recipients/VVLx5OdKvw0dRSjT2rGOc6Y*\\\" \\\\\\n       -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\"\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"VVLx5OdKvw0dRSjT2rGOc6Y*\\\",\\n  \\\"organization\\\": \\\"yAM*fDkztrT3gUcz9mNDgNOL\\\",\\n  \\\"timeCreated\\\": 1455156665000,\\n  \\\"timeLastModified\\\": 1455156665741,\\n  \\\"name\\\": \\\"Neiman Runtilly\\\",\\n  \\\"phone\\\": \\\"+16505551133\\\",\\n  \\\"notes\\\": \\\"Always orders our GSC special\\\",\\n  \\\"skipSMSNotifications\\\": false,\\n  \\\"metadata\\\": []\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"recipients","type":"basic","title":"Recipients"}
A recipient is an organization’s customer and a target for a task, that is, whom the task is being delivered to. [block:api-header] { "type": "post", "title": "Create recipient" } [/block] Body parameters [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "name", "0-1": "string", "0-2": "The recipient’s complete name.", "1-0": "phone", "1-1": "string", "1-2": "A unique, valid phone number as per the recipient’s organization’s ```country```.", "2-0": "notes", "2-1": "string", "2-2": "Optional. Notes for this recipient: these are global notes that should not be task- or destination-specific. For example, *\"Customer since June 2012, does not drink non-specialty coffee\"*.", "3-0": "skipSMSNotifications", "3-1": "boolean", "3-2": "Optional. Whether this recipient has requested to not receive SMS notifications. Defaults to ```false``` if not provided.", "4-0": "skipPhoneNumberValidation", "4-1": "boolean", "4-2": "Optional. Whether to skip validation of this recipient's phone number. An E.164-like number is still required (must start with `+`), however the API will not enforce any country-specific validation rules." }, "cols": 3, "rows": 5 } [/block] [block:code] { "codes": [ { "code": "$ curl -X POST \"https://onfleet.com/api/v2/recipients\" \\\n -u \"cd3b3de84cc1ee040bf06512d233719c:\" \\\n -d '{\"name\":\"Boris Foster\",\"phone\":\"650-555-1133\",\"notes\":\"Always orders our GSC special\"}'", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"VVLx5OdKvw0dRSjT2rGOc6Y*\",\n \"organization\": \"yAM*fDkztrT3gUcz9mNDgNOL\",\n \"timeCreated\": 1455156665000,\n \"timeLastModified\": 1455156665390,\n \"name\": \"Boris Foster\",\n \"phone\": \"+16505551133\",\n \"notes\": \"Always orders our GSC special\",\n \"skipSMSNotifications\": false,\n \"metadata\": []\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "put", "title": "Update recipient" } [/block] [block:code] { "codes": [ { "code": "$ curl -X PUT \"https://onfleet.com/api/v2/recipients/VVLx5OdKvw0dRSjT2rGOc6Y*\" \\\n -u \"cd3b3de84cc1ee040bf06512d233719c:\" \\\n -d '{\"name\":\"Neiman Runtilly\"}'", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"VVLx5OdKvw0dRSjT2rGOc6Y*\",\n \"organization\": \"yAM*fDkztrT3gUcz9mNDgNOL\",\n \"timeCreated\": 1455156665000,\n \"timeLastModified\": 1455156665741,\n \"name\": \"Neiman Runtilly\",\n \"phone\": \"+16505551133\",\n \"notes\": \"Always orders our GSC special\",\n \"skipSMSNotifications\": false,\n \"metadata\": []\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "get", "title": "Find recipient" } [/block] You can search for recipients by ```name``` or ```phone```. Note that finding a recipient requires that there be an exact match for the target property provided. Names are case insensitive and must be properly encoded, while phones will be automatically E.164-formatted prior to performing the lookup as per your organization's ```country``` setting. To find a recipient by name, the endpoint format is ```/name/:name```, for example, ```/name/jony%20chives```. Similarly, to find a recipient by phone, the format is ```/phone/:phone```, for example, ```/phone/4155521837```. [block:code] { "codes": [ { "code": "$ curl -X GET \"https://onfleet.com/api/v2/recipients/name/neiman%20runtilly\" \\\n -u \"cd3b3de84cc1ee040bf06512d233719c:\"", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"7tuqrtwo75UlcJFCzDk7Clfk\",\n \"organization\": \"yAM*fDkztrT3gUcz9mNDgNOL\",\n \"timeCreated\": 1455142309000,\n \"timeLastModified\": 1455142309695,\n \"name\": \"Neiman Runtilly\",\n \"phone\": \"+16503201133\",\n \"notes\": \"Always orders our GSC special\",\n \"skipSMSNotifications\": false,\n \"metadata\": []\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "get", "title": "Get single recipient" } [/block] [block:code] { "codes": [ { "code": "$ curl -X GET \"https://onfleet.com/api/v2/recipients/VVLx5OdKvw0dRSjT2rGOc6Y*\" \\\n -u \"cd3b3de84cc1ee040bf06512d233719c:\"", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"VVLx5OdKvw0dRSjT2rGOc6Y*\",\n \"organization\": \"yAM*fDkztrT3gUcz9mNDgNOL\",\n \"timeCreated\": 1455156665000,\n \"timeLastModified\": 1455156665741,\n \"name\": \"Neiman Runtilly\",\n \"phone\": \"+16505551133\",\n \"notes\": \"Always orders our GSC special\",\n \"skipSMSNotifications\": false,\n \"metadata\": []\n}", "language": "json" } ] } [/block]