Get Devices (MDM Tokens) Assigned to Device Group

Release Time
06/07/2018
Views
6831 times
Category
ITSM
Tags

This resource provides devices (mdmTokens) assigned to device group. 

Scheme

https

Host

Valid ITSM host (example: subdomain-msp.cmdm.comodo.com )

Path 

/api/rest/v1/device-group/assigned-device-mdm-tokens-list

Query Params

Param Name Description Limitation
id Group id required

 

Request Headers

Key Value Description
Http method GET Http method
Content-Type application/json  
x-auth-type 4 Authentication type identifier
x-auth-token access token 3rd Party Authentication Token

See the below links for more detail:

Example:

curl

curl -X GET -H "Content-Type: application/json" -H "x-auth-type: 4"  -H "x-auth-token: e087f80be7add78cea126174f474ad33" -H "Cache-Control: no-cache" "https://subdomain-msp.env.comodo.com/api/rest/v1/device-group/assigned-device-ids-list?id=1

PHP/cUrl

<?php

 

$curl = curl_init();

 

curl_setopt_array($curl, array(

  CURLOPT_PORT => "82",

  CURLOPT_URL => "https://subdomain-msp.env.comodo.com/api/rest/v1/device-group/assigned-device-ids-list?id=1",

  CURLOPT_RETURNTRANSFER => true,

  CURLOPT_ENCODING => "",

  CURLOPT_MAXREDIRS => 10,

  CURLOPT_TIMEOUT => 30,

  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,

  CURLOPT_CUSTOMREQUEST => "GET",

  CURLOPT_HTTPHEADER => array(

    "cache-control: no-cache",

    "content-type: application/json",

    "x-auth-token: e087f80be7add78cea126174f474ad33",

    "x-auth-type: 4",

     

  ),

));

 

$response = curl_exec($curl);

$err = curl_error($curl);

 

curl_close($curl);

 

if ($err) {

  echo "cURL Error #:" . $err;

} else {

  echo $response;

}

Python

import http.client

 

conn = http.client.HTTPSConnection("subdomain-msp.env.comodo.com")

 

headers = {

    'content-type': "application/json",

    'x-auth-type': "4",

    'x-auth-token': "e087f80be7add78cea126174f474ad33",

    'cache-control': "no-cache",

     

    }

 

conn.request("GET", "/api/rest/v1/device-group/assigned-device-ids-list?id=1", headers=headers)

 

res = conn.getresponse()

data = res.read()

 

print(data.decode("utf-8"))

Execution

Sample execution can be handled via Postman Application. 

Header part can be handled via Postman Application

Success Output

Error Output