Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Use /entity routing instead of /user

...

Excerpt

Registers a mobile device of either type iOS or Android to an accountentity. Registration may optionally contain information about the device token for dispatch of push messages. This end point should be called once every time the mobile app is started.

 

...


Endpoint ID:4001
Method:
Status
colour

...

Green
titlePOST
URL:

/mobile/device/registration/entity/id/{entity-id}

/mobile/device/registration/entity/ext-key/{ext-key}/{ext-type}



entity-id

Rubiq entity ID that uniquely identifies an account to register mobile device with


ext-key

External key that uniquely identifies an account to register mobile device with


ext-type

Type of external key

Request body:

JSON data with information about type of mobile device and optionally information about the device token for dispatch of push messages. Setting device ID will enable push messaging to the device.

Required fields

deviceType:

 Must be one of: “iOS”, “Android”, "WindowsPhone", "Windows8" or "BlackBerry"

Optional fields

push:

Setting the “push” value to either true or false will turn push messaging on or off, but only if a device id has been previously registered. This field is ignored for iOS devices, where push notifications are not managed by the app.


Code Block
titleExample 1 – Register an iOS device but without push
{
	"deviceType": "iOS"
}


Code Block
titleExample 2 – Register an iOS device with push
{
	"deviceType": "iOS",
	"deviceID": "671c6845e85b4873596fcee5da2f1bc25b2d038a710c12bf992"
}


Code Block
titleExample 3 – Register an Android device with push
{
	"deviceType": "Android",
	"deviceID": "671c6845e85b4873596fcee5da2f1bc25b2d038a710c12bf992"
}


Code Block
titleExample 4 – Turn off push messaging for an Android device
{
	"deviceType": "Android",
	"deviceID": "671c6845e85b4873596fcee5da2f1bc25b2d038a710c12bf992",
	"push": false
}



Span
stylewhite-space:pre

Response body:


JSON data with information about the newly registered mobile device

Code Block
titleExample 1 – iOS device was just successfully registered:
{
	"deviceID": "671c6845e85b4873596fcee5da2f1bc25b2d038a710c12bf992",
	"deviceType": "iOS"
}


Code Block
titleExample 2 – Android device was just successfully registered:
{
	"deviceID": "671c6845e85b4873596fcee5da2f1bc25b2d038a710c12bf992",
	"deviceType": "Android",
	"push": true
}


Code Block
titleExample 3 – Android device was just successfully registered without device id (no push messaging):
{
	"deviceType": "Android",
	"push": false
}


Code Block
titleExample 4 – iOS device was just successfully registered without device id (no push messaging):
{
	"deviceType": "iOS"
}


Status codes:201

Mobile device was registered successfully


303

Mobile device is already registered for the calling app and the specified account

This response will not have a response body, but will instead contain a Location header, referring to endpoint 4003: Get device which returns the relevant response body.


404

Account was not found

The following sub codes may be returned:

404.1User not found
404.2External user could not be found