post https://public-api.vibescm.com/mobile_apps//devices//assign
Before you start...
Before you get started, we recommend review the Associate Person to Device customer API in the Vibes Push SDK section to understand how and when this API call should be used.
This POST
method assigns a given device to a person record.
Notes:
- If a
person_key
is supplied, and a person with thatperson_key
does not exist, that will result in an error. - If an
external_person_id
is supplied and a person with thatexternal_person_id
does not exist, then theexternal_person_id
will be assigned to the Person currently associated with the device. - If the indicated person exists and the device is not already associated with them, it will be moved to be associated with them.
- If the indicated person is already associated with the device, then nothing will be done and a success response will be returned.
Response
If the call is successful, the response will include the newly associated person entity. Now that the vibes_device_id
and external_device_id
are associated, you can use person data to target push messaging to the user’s push device.
In the case of an error, a standard public API error response will be returned instead. Below is a list of some common responses you may see.
Status Code | Meaning | Response Type |
---|---|---|
200 - OK | The device was successfully assigned to the given person. | Success |
404 - Not Found | The vibes_device_id or person_key (if provided) could not be found. | Failure |
422 - Unprocessible Entity | The requested assignment could not be completed. Reason will be stated in the response body. | Failure |