XML or JSON Response Body
When a WS V2 or higher API is executed, and HTTP status code is HTTP_OK (value 200), a XML/JSON
response body is returned, to indicate the API result.
The following is an example of the GET method API, used to query the receiver data. If the GET API is
successfully executed, the response body displays the requested data.
$ curl -k -H "X_SESSION-ID: $token" "https://192.168.0.1/ws/v2/status/input/rf?port=1&js=1"
{
"input": {
"rf": {
"port": "1",
"dnlkfreq": "28.3465",
"symrate": "28.3465",
"fec": "2/3",
"mod": "QPSK DVB-S",
"rolloff": ".35",
"iq": "Normal",
"pwr": "Off",
"sel22khz": "Off",
"lo1": "5.15",
"lo2": "0.0",
"pol": "Horizontal",
"orbpos": "0.0",
"ewflag": "N/A",
"afcrange": "3.0",
"acqmode": "Basic",
"satlock": "No Lock",
"inputrate": "0.0",
"netname": "",
"netid": "1",
"transid": "",
"Isttunerea": "User_Change",
"tunereason": "User",
"freqmode": "NIT",
"swclstmode": "Rigorous",
"baten": "No",
"niten": "Yes",
"sdten": "No",
"paten": "No"
}
}
}
If an error occurs, a generic "failed" response body is provided to indicate the API failed, and a text message
to indicate the failure reason. For example:
$ curl -k -H "X_SESSION-ID: $token" "https://192.168.0.1/ws/v2/status/input/rf?port=1&js=1"
{
"response": {
"code": "10",
"result": "failed",
"message": "Access denied (must be admin or user)"
}
}
The following is an example of the POST method API. It displays a generic "success" response. An API
requires a specific response body when a POST API is executed successfully.
$ curl -k -H "X_SESSION-ID: $token" -X POST
"https://192.168.0.1/ws/v2/service_cfg/input/rf?port=1&&dnlkfreq=3.51&js=1"
{
"response": {
"code": "10",
"result": "success",
"message": ""
}
}
Cisco D9800 Network Transport Receiver Version 2.75 RESTful Web Services API Reference Guide
6
Web Services API
XML or JSON Response Body