The WiNG API returns standard HTTP status codes in addition to JSON-based error codes and messages in the response body.
HTTP Response Status Codes
| Code | Description |
|---|---|
| 200 OK | The request was successful |
| 201 Created | The resource was created successfully |
| 204 No Content | Success with no response body |
| 400 Bad Request | The operation failed because the request is syntactically incorrect or violated schema |
| 401 Unauthorized | The authentication credentials are invalid or the user is not authorized to use the API |
| 404 Not Found | The server did not find the specified resource that matches the request URL |
| 405 Method Not Allowed | The API does not support the requested HTTP method |
If an API request is successful, the response looks similar to the following example:
{
"success" : true
"return_code" : 0
"data" : <some data> - if the call returns data
}
If an API request cannot be completed or results in an error, the response looks similar to the following example:
{
"success" : false
"errors": "get [wlan/rest-1/vlans/102] is not valid - vlans[102] does not exist",
"return_code": 1
}
WiNG can encrypt configuration parameters containing confidential information, e.g. wireless keys, SNMP community strings, etc. Encryption is enabled by the password-encryption CLI command. When enabled, REST calls return encrypted data instead of clear text values for these parameters.
{
"data": [
{
"access": "ro",
"ip_snmp_accesslist": "default",
"name":"CRbtqHNZDOjKTEv4+uQ/CQAAAAVzEVuqRcuiQmypSVMKJ3vx"
// Values are encrypted
},
{
"access": "rw",
"ip_snmp_accesslist": "default",
"name": "$ES1" // Alias names are not encrypted
}
],
"return_code": 0
}