com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_link3' is unknown.

Advanced Search for Devices via the Console

Description

Carry out an advanced search via the EMM console. For more information on the search workflow, see Advanced Device Search on WSO2 EMM.

Resource Path/
URL/mdm-admin/search
HTTP MethodPOST
Request/Response Formatapplication/json
cURL command
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <EMM_API_TOKEN>" -d @'<JSON_PAYLOAD>' -k -v https://<EMM_HOST>:<EMM_HTTPS_PORT>/mdm-admin/search
  • For more information on how to generate the <EMM_API_TOKEN>, see Generating the EMM API Token.
  • Define the path to the JSON file, which includes the required properties to carry out the operation, as the <JSON_PAYLOAD> value. For more information, see the Sample JSON Definition.
  • 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.

Example: Getting all the operations that can be carried out by the android device type.

curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -d @'search.json' -k -v https://localhost:9443/mdm-admin/search
 Sample output
> POST /mdm-admin/search HTTP/1.1
> Host: localhost:9443
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Type: application/json
> Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a
> Content-Length: 231
< HTTP/1.1 200 OK
< Date: Thu, 31 Mar 2016 12:24:37 GMT
< Content-Type: application/json
< Content-Length: 2
< Server: WSO2 Carbon Server

Sample JSON output Definition 
{
  "conditions": [
    {
      "key": "BATTERY_VOLTAGE",
      "value": "40",
      "operator": "=",
      "state": "AND"
    },
    {
      "key": "CPU_USAGE",
      "value": "40",
      "operator": ">",
      "state": "OR"
    },
    {
      "key": "LOCATION",
      "value": "Colombo",
      "operator": "=",
      "state": "AND"
    }
  ]
}
PropertyDescriptionData
Type 
conditionsContains the advance search parameters-
key

Provide the operation code. You can assign the following operation codes:

  • DEVICE_MODEL : The model of the device.

  • VENDOR : The name of the device vendor.

  • OS_VERSION : The version of the device operating system.

  • BATTERY_LEVEL : The current level of the device battery.

  • INTERNAL_TOTAL_MEMORY : The total capacity of the internal memory available in the device.

  • INTERNAL_AVAILABLE_MEMORY : The internal memory in the device that is available.

  • EXTERNAL_TOTAL_MEMORY : The total capacity of the external memory available in the device.

  • EXTERNAL_AVAILABLE_MEMORY : The external memory in the device that is available.

  • CONNECTION_TYPE : Define if the device is connected to the GPRS or Wi-Fi settings.

  • SSID : The name of the Wifi network that the device is connected to.

  • CPU_USAGE : The current CPU usage of the mobile device.

  • TOTAL_RAM_MEMORY : The total capacity of the random access memory available in the device.

  • AVAILABLE_RAM_MEMORY : The random access memory capacity in the device that is available.

  • PLUGGED_IN : Define true if the device is plugged in for charging or define false if the device is not plugged in for charging.
String
value

Define the value for the key you provide.

Example: If you provide the key as VERSION, you can provide the value as 5.1, which indicates the version of the mobile device you are searching.

String
operator

Define the search condition between the key and the value you provide. The following values can be used to define the search condition:

  • = : Searches for devices where the key is equal to the value provided.
  • =! : Searches for devices where the key is not equal to the value provided.
  • <= : Searches for devices where the key is greater than or equal to the value provide.
  • >= : Searches for devices where the key is less than or equal to the value provided.
  • > : Searches for devices where the key is greater than the value provided.
  • < : Searches for devices where the key is less than the value provided.

Example: If you wish to get the devises that have the version as 5.1, you need to use the = operator.

String
state

There can be many search options as shown in the sample JSON definition. The field that connects the independent search options, is known as state.

The following values can be assigned to state.

  • AND : Defines if you want the search result to match all the search conditions provided.
  • OR : Defines if you want the search result to match either of the search conditions provided.
String
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.