Contact Information: Push

Management of push contact information

Contact Information: Push

Along with the phone number and email, push device registration is one of the ways to contact a specific person. One person can have one or more push devices. One single push device always belongs to one person. Push registration ID of a device is a unique identifier across all people.

SDKs

Push device data is mostly managed by the mobile SDKs for Android, iOS, and Cordova. Some data about the device is gathered by the SDK automatically, such as Application version or Device model. Such data is marked as read-only in the model below. There are also other types of data such as Primary flag or Additional data attributes which can be managed both through the SDK and via HTTP APIs.

Methods

Resource

https://api.infobip.com/people/2/contactInformation/push

Model

Application code

Note that application code should be provided for each HTTP request via AppCode header. You can find a specific application code at the Applications page at Infobip Portal. Refer to request examples below for more details.

Body parameters

Property name Type Description
registrationId string
(read-only)
Registration identifier of a particular push device registration
applicationId string
(read-only)
Internal identifier of a push application configuration
isPrimary boolean Set to true if this device is a primary device of a user among other devices
systemData System data Set of push-specific attributes, see System data
additionalData List of custom attributes Custom attributes set for a device, see Custom attributes

System data

Set of push-specific attributes of a registration.

Property name Type Description
registrationEnabled boolean State of the device registration
notificationsEnabled boolean (read-only) Set to true if notifications are enabled on a device
geofencingSdk boolean (read-only) Set to true if geo fencing is enabled on a device
sdkVersion string (read-only) SDK version that is running on a device
appVersion string (read-only) The version of the application which SDK is embedded into
os string (read-only) Operating system type can be Android or iOS
osVersion string (read-only) The version of the operating system
deviceManufacturer string (read-only) The manufacturer of the device as detected by the SDK
deviceModel string (read-only) The model of the device
deviceSecure boolean (read-only) Set to true if the device has any type of secure screen lock set up
osLanguage string (read-only) An identifier of the language used on a device
deviceTimezoneOffset string (read-only) UTC-related timezone offset that identifies a current timezone of a device
deviceName string (read-only) The name of the device as configured by a user

Additional data

Additional data specifies a list of custom values assigned to a device. Such attributes can be used later on in order to be able to target a specific device of a Person, for example:

  • Set an attribute receiveOneTimePasswords : true
  • Later on, target your messages using device subscriptions of OMNI Channel Messaging APIs or segmentation in Infobip Portal

Attribute fields Type Description Limits
name string Name of the attribute 256 characters max
value string, number, boolean, date Value of the attribute Max value for number is 9223372036854775807. Max value for a string is 4096 characters. The date is YYYY-MM-DD.

Method details

Get push device registration

Use this method to get device data:

Request:

GET /people/2/contactInformation/push/d2463a09-1cf8-4e07-a063-041d4195d171 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
AppCode: 87dc5af9bb50ebe3df341c89d2463a09-1cf8-4e07-a063-041d4195d172

Response:

{
    "registrationId": "8621824C-86B2-41F7-BF6F-20D3B1426005",
    "applicationId": "753CBCDC1D587223934106E2A2AEDD44",
    "isPrimary": false,
    "systemData": {
        "cloudType": "GCM",
        "registrationEnabled": true,
        "notificationsEnabled": true,
        "geofencingSdk": true,
        "sdkVersion": "2.0.9.1",
        "appVersion": "1.16.0-SNAPSHOT",
        "os": "Android",
        "osVersion": "8.0.0",
        "deviceManufacturer": "HUAWEI",
        "deviceModel": "ANE-LX1",
        "deviceSecure": true,
        "osLanguage": "en",
        "deviceTimezoneOffset": "GMT+03:00",
        "deviceName": "ANE-LX1"
    }
}

Update push device registration

Use this method to update device data:

Request:

PATCH /people/2/contactInformation/push/d2463a09-1cf8-4e07-a063-041d4195d171 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
Content-Type: application/json
AppCode: 87dc5af9bb50ebe3df341c89d2463a09-1cf8-4e07-a063-041d4195d172

{
    "isPrmary": true,
    "systemData": {
        "registrationEnabled": true
    },
    "additionalData": {
        "receiveOTP": true
    }
}

Response:

{
    "registrationId": "8621824C-86B2-41F7-BF6F-20D3B1426005",
    "applicationId": "753CBCDC1D587223934106E2A2AEDD44",
    "isPrimary": false,
    "additionalData": {
        "receiveOTP": true
    },
    "systemData": {
        "cloudType": "GCM",
        "registrationEnabled": true,
        "notificationsEnabled": true,
        "geofencingSdk": true,
        "sdkVersion": "2.0.9.1",
        "appVersion": "1.16.0-SNAPSHOT",
        "os": "Android",
        "osVersion": "8.0.0",
        "deviceManufacturer": "HUAWEI",
        "deviceModel": "ANE-LX1",
        "deviceSecure": true,
        "osLanguage": "en",
        "deviceTimezoneOffset": "GMT+03:00",
        "deviceName": "ANE-LX1"
    }
}

Personalize

Each person can have Phone numbers, Emails or External ID. These fields are unique identifiers of a person on Infobip platform and provide a capability to personalize any push device registration with a person profile. The platform provides data grouping functions based on these parameters. For example, if two devices will try to save the same Phone number, then both of them will be collected under a single person. Phone number, Email and External ID are also widely used when targeting users with messages across different channels via Infobip platform.

You can use the method below to personalize a device:

Query parameter Type Description
forceDepersonalize boolean You can set this parameter to true If you want previous personalization to be always reset. Do not use this parameter if you want to know when there’s an attempt to personalize already personalized registration.
Body parameter Type Description
identity An object that contains an externalId, phoneNumber or email Unique identifiers from this object will be used to find a person to personalize push registration with. Notice: for externalId any string values such as “null”, “Null” or “NULL” are not supported and would be considered as JSON null
attributes An object that contains zero or more person fields such as firstName, gender, customAttributes, tags etc. Data specified in this object will be applied to the target person upon personalization.

Request:

POST /people/2/contactInformation/push/d2463a09-1cf8-4e07-a063-041d4195d171/personalize?forceDepersonalize=true HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
Content-Type: application/json
AppCode: 87dc5af9bb50ebe3df341c89d2463a09-1cf8-4e07-a063-041d4195d172

{
    "identity": {
        "phoneNumber": "79810000000"
    },
    "attributes": {
        "tags": ["Pizza", "Sports"] 
    }
}

Response:

{
    "externalId": "jdoe",
    "firstName": "John",
    "lastName": "Doe",
    "birthday": "1985-07-12",
    "tags": [
        "Pizza",
        "Sports"
    ],
    "contactInformation": {
        "phones": [
            {
                "number": "79810000000"
            }
        ],
        "emails": [
            {
                "address": "my.email@gmail.com"
            }
        ]
    }
}

Depersonalize

You can depersonalize a device to detach it from a current person profile so that the device won’t receive messages when targeted by any of the person attributes:

Request:

POST /people/2/contactInformation/push/d2463a09-1cf8-4e07-a063-041d4195d171/depersonalize HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
Content-Type: application/json
AppCode: 87dc5af9bb50ebe3df341c89d2463a09-1cf8-4e07-a063-041d4195d172

Response: