Child pages
  • Manage2 API - Return Data
Skip to end of metadata
Go to start of metadata

 

Introduction

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:

The examples below display each output format with the List Package Information function.

Note:

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

Basic Return Data

To view the output of the API function in XML, call the function without the output variable. For example:

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

The output will resemble the following example:

<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>

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

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

The output will resemble the following example:

{
   "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"
}

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

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

The output will resemble the following example:

--- 
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