Manage2 Return Data


Last modified: March 9, 2021

Overview

By default, the Manage2 API outputs data in Extensible Markup Language (XML). To change a call’s output, specify the output variable when you call the function. Manage2 API functions return data in two additional formats:

Note:

URL arguments are not ordered. You can specify the output variable at any point in the function call.

Basic return data

The Manage2 API returns data in JSON, XML, and YAML format. The examples below display each output format with the Manage2 API List Package Information function:

JSON output

To view a Manage2 API function’s output data in JSON format, append ?output=json to the URL:

https://server.example.com/XMLpackageInfo.cgi?output=json

The output will resemble the following example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
   "packages":{
      "P0003":"RESELLER-INTERNAL-VPS",
      "P0005":"ONE-YEAR",
      "P0002":"RESELLER-INTERNAL",
      "P0004":"THREE-YEAR",
      "P0006":"TWO-YEAR",
      "P0001":"ONE TIME FEE"
   },
   "status":1,
   "version":0.3,
   "reason":"OK"
}

XML output

By default, the Manage2 API returns output in XML. To view the output of the API function in XML, call the function without the output variable:

https://server.example.com/XMLpackageInfo.cgi

The output will resemble the following example:

1
2
3
<XMLpackageInfo reason="OK" status="1" version="0.3">
     <packages P0001="ONE TIME FEE" P0002="RESELLER-INTERNAL" P0003="RESELLER-INTERNAL-VPS" P0004="THREE-YEAR" P0005="ONE-YEAR" P0006="TWO-YEAR"/>
</XMLpackageInfo>

YAML output

To view a Manage2 API function’s output data in YAML format, append ?output=yaml to the end of the URL:

https://server.example.com/XMLpackageInfo.cgi?output=yaml

The output will resemble the following example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
---
packages:
  P0001: ONE TIME FEE
  P0002: RESELLER-INTERNAL
  P0003: RESELLER-INTERNAL-VPS
  P0004: THREE-YEAR
  P0005: ONE-YEAR
  P0006: TWO-YEAR
reason: OK
status: 1
version: 0.3

Additional Documentation