Unknown macro: {next_previous_link3}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Description

If you wish to get the details of the devices enrolled by a specific user, you can do so using the REST API given below.

Resource Path/devices
URL/mdm-admin/users/devices?username={username}
HTTP MethodGET
Request/Response Formatapplication/json
cURL command
curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <EMM_API_TOKEN>" -k -v https://<EMM_HOST>:<EMM_HTTPS_PORT>/mdm-admin/users/view?username={username}
  • For more information on how to generate the <EMM_API_TOKEN>, see Generating the EMM API Token.
  • By default, <EMM_HOST> is localhost. However, if you are using a public IP, the respective IP address or domain needs to be specified.
  • By default, <EMM_HTTPS_PORT> has been set to 9443. However, if the port offset has been incremented by n, the default port value needs to be incremented by n.
  • Provide the name of the user you wish to get the details as the value for {username}. If you are unsure of the exact user name, run the REST API command to retrieve all the user details to find out the username.

Example:

curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -k -v https://localhost:9443/mdm-admin/users/view?username=kim

You can filter the device details further, using the query parameters given below:

  • start - Provide the starting pagination index. Example 10

    A user will have many devices enrolled with the EMM. In a situation where you wish to view the all the registered devices it is not feasible to show all the details on one page therefore the details are paginated.

  • length - Provide how many device details you require from the starting pagination index. For example if you require the device details from the 10th pagination index to the 15th, you must define 10 as the value for start and 5 as the value for length.

    If you wish to get the device details within a predefined index range you need to define both the  start  and  length  fields.
    Example:  https://localhost:9443/mdm-admin/devices?start=10&length=5
    There will be situations were you will not have device details in the specified index range. In such situation all the details of the devices registered to the specified user is given.

Example:

curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -k -v https://localhost:9443/mdm-admin/users/view?username=kim&start=1&length=3
 Sample output
> GET /mdm-admin/users/devices?username=kim HTTP/1.1
> Host: localhost:9443
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Type: application/json
> Authorization: Bearer 6171fbf32fd653c29f14f0acef1900ca
> 
< HTTP/1.1 200 OK
< Cache-Control: private
< Expires: Thu, 01 Jan 1970 05:30:00 IST
< Date: Sat, 05 Mar 2016 07:04:46 GMT
< Content-Type: application/json
< Content-Length: 1196
< Server: WSO2 Carbon Server
[{"id":1,"name":"titan_umts","type":"android","description":"titan_umts","deviceIdentifier":"359298055243973","enrolmentInfo":{"id":1,"dateOfEnrolment":1457160869352,"dateOfLastUpdate":1457160869352,"ownership":"BYOD","status":"ACTIVE","owner":"admin"},"properties":[{"name":"IMEI","value":"359298055243973"},{"name":"IMSI","value":"413025702363929"},{"name":"DEVICE_MODEL","value":"XT1064"},{"name":"OS_VERSION","value":"6.0"},{"name":"VENDOR","value":"motorola"},{"name":"SERIAL"},{"name":"DEVICE_INFO","value":"[{\"name\":\"IMEI\",\"value\":\"359298055243973\"},{\"name\":\"IMSI\",\"value\":\"413025702363929\"},{\"name\":\"DEVICE_MODEL\",\"value\":\"XT1064\"},{\"name\":\"VENDOR\",\"value\":\"motorola\"},{\"name\":\"OS_VERSION\",\"value\":\"6.0\"},{\"name\":\"DEVICE_NAME\",\"value\":\"titan_umts\"},{\"name\":\"BATTERY_LEVEL\",\"value\":\"88\"},{\"name\":\"INTERNAL_TOTAL_MEMORY\",\"value\":\"5.51\"},{\"name\":\"INTERNAL_AVAILABLE_MEMORY\",\"value\":\"0.43\"},{\"name\":\"EXTERNAL_TOTAL_MEMORY\",\"value\":\"0.0\"},{\"name\":\"EXTERNAL_AVAILABLE_MEMORY\",\"value\":\"0.0\"},{\"name\":\"OPERATOR\",\"value\":\"Dialog\"}]"},{"name":"DEVICE_NAME","value":"titan_umts"},{"name":"GCM_TOKEN"}]}]
Sample JSON Output Definition 
[
  {
    "id": 1,
    "name": "titan_umts",
    "type": "android",
    "description": "titan_umts",
    "deviceIdentifier": "359298055243973",
    "enrolmentInfo": {
      "id": 1,
      "dateOfEnrolment": 1457160869352,
      "dateOfLastUpdate": 1457160869352,
      "ownership": "BYOD",
      "status": "ACTIVE",
      "owner": "admin"
    },
    "properties": [
      {
        "name": "IMEI",
        "value": "359298055243973"
      },
      {
        "name": "IMSI",
        "value": "413025702363929"
      },
      {
        "name": "DEVICE_MODEL",
        "value": "XT1064"
      },
      {
        "name": "OS_VERSION",
        "value": "6.0"
      },
      {
        "name": "VENDOR",
        "value": "motorola"
      },
      {
        "name": "SERIAL"
      },
      {
        "name": "DEVICE_INFO",
        "value": "[{\"name\":\"IMEI\",\"value\":\"359298055243973\"},{\"name\":\"IMSI\",\"value\":\"413025702363929\"},{\"name\":\"DEVICE_MODEL\",\"value\":\"XT1064\"},{\"name\":\"VENDOR\",\"value\":\"motorola\"},{\"name\":\"OS_VERSION\",\"value\":\"6.0\"},{\"name\":\"DEVICE_NAME\",\"value\":\"titan_umts\"},{\"name\":\"BATTERY_LEVEL\",\"value\":\"88\"},{\"name\":\"INTERNAL_TOTAL_MEMORY\",\"value\":\"5.51\"},{\"name\":\"INTERNAL_AVAILABLE_MEMORY\",\"value\":\"0.43\"},{\"name\":\"EXTERNAL_TOTAL_MEMORY\",\"value\":\"0.0\"},{\"name\":\"EXTERNAL_AVAILABLE_MEMORY\",\"value\":\"0.0\"},{\"name\":\"OPERATOR\",\"value\":\"Dialog\"}]"
      },
      {
        "name": "DEVICE_NAME",
        "value": "titan_umts"
      },
      {
        "name": "GCM_TOKEN"
      }
    ]
  }
]
ParameterDefinition
idThe ID of the device.
nameThe name of the device. 
type

The mobile platform of the device. Example: android, ios or windows

descriptionA description of the registered device.

deviceIdentifier

The device ID.

enrolmentInfo

Provide the device enrollment information.

id

The device ID. 

dateOfEnrolment

The date the device was enrolled.

The date is given in the Epoch time format.

dateOfLastUpdate

The date the device was last updated.

The date is given in the Epoch time format.

ownership

Provides the ownership details. The ownership type can be any of the values given below:
  • BYOD - Bring your own device (BYOD).
  • COPE - Corporate owned personally enabled (COPE). 

status

The status of the device. A device can be in the active or inactive state.

owner

Provides the device owner's name.

properties

The properties provide the following information:

  • IMEI:

  • IMSI:

  • DEVICE_MODEL:

  • OS_VERSION:

  • VENDOR:

  • SERIAL:

  • DEVICE_INFO:

  • GCM_TOKEN:

  • DEVICE_NAME:

  • No labels