Manage App Users (deprecated)

This API has been deprecated. If support for multiple devices per user is enabled for an app, this API will be disabled for the app and replaced with the API to Manage App Users and Sessions.

Managing Mobile Users

A mobile user's app is associated with an App Instance by means of an enrollment. The mobile user model (e.g. user) returns additional data to facilitate this.

Parameters

To retrieve, create, update or delete mobile users, follow the instructions in these sections of the documentation for your mobile user object type (e.g. user):

  • Retrieve all Objects

  • Create a New Object

  • Update a Single Object

  • Delete a Single Object

Deleting the user will disable the user's application. This operation is irreversible.

Response

The response includes all data normally returned by the basic operations: Create, Update, etc.

Additionally, enrollment details for the user are returned under an enrollment field:

  • Whether the device has scanned the enrollment barcode and successfully enrolled

  • The URL to which the app must connect to enroll, which is typically encoded in a QR code.

Example

We retrieve an object of our mobile user object type (i.e. user):

http
GET https://run-testing-us.journeyapps.com/api/v4/533bda53027894f69b001055/objects/user.json
curl
curl "https://run-testing-us.journeyapps.com/api/v4/533bda53027894f69b001055/objects/user.json" \
    -u "533bda53027894f69b001055:7Ajj5htRY1uzw7b4w23V"
ruby
require 'rest-client'
journey = RestClient::Resource.new "https://run-testing-us.journeyapps.com/api/v4", "533bda53027894f69b001055", "7Ajj5htRY1uzw7b4w23V"
journey["533bda53027894f69b001055/objects/user.json"].get

The response objects have an enrollment field that shows the user's enrollment status in enrolled and the URL for their enrollment barcode in url:

json
{
  "objects": [
  {
    "id": "1e47acd2-ad0f-11e4-8513-001e6733fe3c",
    "type": "user",
    "updated_at": "2015-02-05T08:16:02Z",
    "display": "Bruce Wayne",
    "name": "Bruce Wayne",
    "enrollment": {
      "enrolled": false,
      "barcode": "https://chart.googleapis.com/chart?chl=https%3A%2F%2Fembark.mobi%2Fenroll%3Fh%3Drun-testing-us.journeyapps.com%26k%3D499388492261%26t%3Dj&choe=UTF-8&chs=250x250&cht=qr",
      "url": "https://embark.mobi/enroll?h=run-testing-us.journeyapps.com&k=499388492261&t=j"
    }
  },
  {
    "id": "3e7e18b0-ad0f-11e4-9d6d-001e6733fe3c",
    "type": "user",
    "updated_at": "2015-02-05T08:16:11Z",
    "display": "Tony Stark",
    "name": "Tony Stark",
    "enrollment": {
      "enrolled": false,
      "barcode": "https://chart.googleapis.com/chart?chl=https%3A%2F%2Fembark.mobi%2Fenroll%3Fh%3Drun-testing-us.journeyapps.com%26k%3D48908435893%26t%3Dj&choe=UTF-8&chs=250x250&cht=qr",
      "url": "https://embark.mobi/enroll?h=run-testing-us.journeyapps.com&k=48908435893&t=j"
    }
  }
],
  "count": 2,
  "total": 2,
  "more": false
}

Resetting a Mobile User's enrollment

A mobile user can be re-enrolled with this function and subsequently scanning the enrollment barcode with the app.

Relative URL
HTTP Request Method

/api/v4/app-instance-id/objects/mobile-model/object-id/re_enroll.json

POST

Replace *mobile-model* with the type of object associated with the mobile user (typically **user**), and *object-id* with the ID of the specific object. The **re_enroll** action effectively disables the user's app, until the enrollment barcode is scanned on the app.

Parameters

This function does not take any parameters.

Response

The response includes a success boolean value.

Example

http
POST https://run-testing-us.journeyapps.com/api/v4/533bda53027894f69b001055/objects/user/3e7e18b0-ad0f-11e4-9d6d-001e6733fe3c/re_enroll.json
curl
curl "https://run-testing-us.journeyapps.com/api/v4/533bda53027894f69b001055/objects/user/3e7e18b0-ad0f-11e4-9d6d-001e6733fe3c/re_enroll.json" \
    -u "533bda53027894f69b001055:7Ajj5htRY1uzw7b4w23V" \
    -X POST
ruby
require 'rest-client'
journey = RestClient::Resource.new "https://run-testing-us.journeyapps.com/api/v4", "533bda53027894f69b001055", "7Ajj5htRY1uzw7b4w23V"
journey["533bda53027894f69b001055/objects/user/3e7e18b0-ad0f-11e4-9d6d-001e6733fe3c/re_enroll.json"].post nil

Response:

json
{
  "success": true
}

Last updated