Skip to end of metadata
Go to start of metadata

Last Updated: Friday, November 22, 2019




Get Push Device

The following will retrieve a push device or list of push devices by its person_idexternal_person_id, or vibes_device_id.  

GET /companies/:company_id/mobiledb/persons/:person_id/push_devices
GET /companies/:company_id/mobiledb/persons/external/:external_person_id/push_devices
GET /mobile_apps/:app_id/devices/:vibes_device_id
Note: A 404 - Not Found error will be returned if the Vibes device cannot be located.

Request JSON

There is no Request JSON with a GET.

Return JSON

{ 
  "device": {
    "vibes_device_id": "k3j2-23nf9-2ndk465-3jks",
    "os": "IOS",
    "os_version": "8.1.3",
    "sdk_version": "1.2",
    "app_version": "2.0.0",
    "push_token": "C9A3F19580B6B3DC41E73B558D9D5BAE81AAC551FA45A1AD22CA2403D6E96469",
    "hardware_make": "Apple",
    "hardware_model": "iPhone5,1",
    "advertising_id": "jke30-skdjrjhs2-ks432-kadf",
    "locale": "en_US",
    "location": {
      "latitude": 42.2537648,
      "longitude": -88.3336466
    },
    "timezone": "America/Chicago",
    "url": "/mobile_apps/:app_id/devices/:vibes_device_id"
  }
}

A push device is only added or updated via the Push SDK itself and not via API calls.

Associate Push Device to Person

Please review the suggested Associate Person to Device customer API in the Vibes Push SDK section to understand how and when this API call should be used.


This call assigns a given device to a specific Person as defined by their person_key or external_person_id. If both are supplied, the person_key will be used and the external_person_id will be ignored.

  • If a person_key is supplied, and a Person with that person_key does not exist, that will result in an error.
  • If an external_person_id is supplied and a Person with that external_person_id does not exist, then the external_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.

Request

POST /mobile_apps/:app_id/devices/:vibes_device_id/assign

Authentication

To make this API call, you must have valid Basic Auth credentials for a user who has public_api:user on the company that the app belongs to, or has the public_api:admin role.

Body

{
  "person_key": "cdb8affd-92fc-4702-b69e-52b3fba32fe1"
}
  
  
OR
  
  
{
  "external_person_id": "123abc"
}


Response – HTTP Status Codes

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 the 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

Successful Response Body

The call will return the newly associated Person, which will be a Person as described in the Person API Methods topic of the Vibes Platform APIs documentation Wiki, using the V2 format.

Error Response Body

In the case of an error, the standard public API error response body will be used. 

Conclusion

After the vibes_device_id and the external_device_id are securely associated, the Vibes Platform will be able to use the Person customer fields to target messaging.




  • No labels