Get Companies

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

This resource provide Companies. 

Scheme

https

Host

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

Path 

/api/rest/v1/company

Query Params
 

Param name Description Limitations

page

interested page  

page-size

how many results in answer

max is 200

 

Request Headers
 

 

Key Value Descriptions

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:

 

Examples

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/company?page=1&page-size=200"

PHP/cUrl
 

<?php

 

$curl = curl_init();

 

curl_setopt_array($curlarray(

  CURLOPT_PORT => "82",

  CURLOPT_URL => "https://subdomain-msp.env.comodo.com/api/rest/v1/company?page=1&page-size=200",

  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/company?page=1&page-size=200", 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