Create recipient
Body parameters
Name | Type | Description |
---|---|---|
name | string | The recipient’s complete name. |
phone | string | A unique, valid phone number as per the organization’s country if there's no leading + sign. If a phone number has a leading + sign, it will disregard the organization's country setting. |
notes | string | 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". |
skipSMSNotifications | boolean | Optional. Whether this recipient has requested to not receive SMS notifications. Defaults to false if not provided. |
skipPhoneNumberValidation | boolean | 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. |
useLongCodeForText | boolean | Setting as true will default the Onfleet system to use a toll-free long code number for SMS communication. |
Onfleet uses Phone (number) as Unique Identifier
The
phone
field is considered a unique identifier in Onfleet, therefore updating the recipient phone number is not allowed.
Recipient details and communication
It is optional to provide recipient details in Onfleet. Any task may be created and executed without recipient details if privacy is a concern or that data is not available. Recipient phone number is a unique identifier for the recipient, without a recipient phone number provided, SMS notifications and communication between driver and recipient will be impossible through Onfleet.
Phone Validation
Onfleet utilizes Google's phone number validation library to verify all phone numbers entered. Use
skipPhoneNumberValidation
in your HTTP request to skip validation.
Use Long Code For Text - This only applies to Canadian Organizations
This is for Canadian organizations that wish to use a toll-free long code to reach their non-Canadian Customers.
Recipient Details
It is optional to provide recipient details in a Task. Any task may be created and executed without recipient details if privacy is a concern or that data is not available. Recipient phone number is a unique identifier for the recipient. Without a recipient phone number provided, SMS notifications and communication between driver and recipient will be impossible through Onfleet.
curl -X POST "https://onfleet.com/api/v2/recipients" \
-u "cd3b3de84cc1ee040bf06512d233719c:" \
-d '{"name":"Boris Foster","phone":"650-555-1133","notes":"Always orders our GSC special"}'
$ curl -X POST "https://onfleet.com/api/v2/recipients" \
-u "cd3b3de84cc1ee040bf06512d233719c:" \
-d '{"name":"Boris Foster","phone":"+1111111111","notes":"Always orders our GSC special", "skipPhoneNumberValidation":true}'
onfleet.recipients.create(body={
"name":"Boris Foster",
"phone":"+1111111111",
"notes":"Always orders our GSC special",
"skipPhoneNumberValidation":True
})
onfleet.recipients.create({
"name":"Boris Foster",
"phone":"+1111111111",
"notes":"Always orders our GSC special",
"skipPhoneNumberValidation":true
});
$onfleet->recipients->create([
"name" => "Boris Foster",
"phone" => "+1111111111",
"notes" => "Always orders our GSC special",
"skipPhoneNumberValidation" => true
]);
{
"id": "VVLx5OdKvw0dRSjT2rGOc6Y*",
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"timeCreated": 1455156665000,
"timeLastModified": 1455156665390,
"name": "Boris Foster",
"phone": "+16505551133",
"notes": "Always orders our GSC special",
"skipSMSNotifications": false,
"metadata": []
}
{
"code": "InvalidContent",
"message": {
"error": 1000,
"message": "The values of one or more parameters are invalid.",
"cause": "Invalid phone number.",
"request": "ac7178da-daa5-43c5-9b4c-5bc759289e9f"
}
}