Register a device with AirBop

Registering with the AirBop servers can be accomplished by posting the correct information to the following URL: http://www.airbop.com/api/v1/register

Required Headers

A list of the required registering headers can be found in the Authentication for Register and Unregister knowledge base article.

Parameters to Pass to the AirBop Servers

When you attempt to register with the AirBop servers the following information can be sent to the server as part of the "post parameters" or "request body." The request body should be sent in JSON format. Examples of how to construct the request body and post to the AirBop servers can be found in the AirBop-Client sample.

The content type passed to the AirBop servers controls the format the body will be expected in. The preferred method is JSON: application/json but form URL encoded will also be accepted: application/x-www-form-urlencoded.

reg

The registration ID received from the Google Cloud Messaging (GCM) servers as described in the GCM Architectural Overview.

country (optional)

The ISO 3166-1 alpha-2 country code. This must be exactly two characters or it will be ignored.

label (optional)

A 50 character string that can be used to 'tag' or 'group' devices. You will be able to target devices based on this value when you send your message from the AirBop servers.

For example if you wanted to label device registrations from tablets vs. phones you could label the phones: phone and the tablets: tablet, or standard and HD. Then you would be able to target each group separately.

lat (optional)

The latitude value of the device. Stored as a float and accurate to one city block.

long (optional)

The longitude value of the device. Stored as a float and accurate to one city block.

lang (optional)

The ISO639-1 language code.

state (optional)

The two character state or province code from the USA or Canada. This must be exactly two characters or it will be ignored.

If the location data is not passed, the server will attempt to fill in the data by performing an IP lookup on the device that posted the data. The location data that the AirBop server gets will be quite accurate (99.5% at a country level and 90% at a state level) so you will only need to provide your own data if you need greater accuracy.

An Example Body

Here is an example of a JSON registration body as generated by the AirBop-Client sample:

{
    "country":"CA",
    "label":"AirBop Sample",
    "lang":"en",
    "lat":"49.897884",
    "long":"-97.1351",
    "reg":"XXXXXXXXXXXXXXXXXX",
    "state":"MB"
}

AirBop Response Codes

Please see the Server Response Codes knowledge base article for more information.

Recent Discussions

05 Oct, 2017 07:23 PM
25 Sep, 2017 01:59 PM
21 Sep, 2017 03:29 PM
05 Sep, 2017 04:24 AM
21 Aug, 2017 05:52 PM