API
Acquire proper authorization for other API requests.
After a successful authentication, the obtained cookie session can be used for other API requests.
Permission GET is granted for Read-only user access, while Permission GET and POST are granted for Read-write user access.
The session is similar to that being used in Web Admin Access, and governed by the same session idle timeout. For a more persistent API access, consider authorization with Client ID / Secret
Available in 7.0.0 or later
Input Parameters
Type | Notation | Mandatory | Description | |
username | String | <string> | require | Username |
password | String | <string> | require | Password |
Return Parameters
Return JSON
Type | Notation | Description | |
permission | Object | <Permission_Obj> | Permission granted. Most APIs require a proper permission to access. |
<Permission_Obj>
Type | Notation | Description | |
GET | Number | { 0, 1 } | 1 – Allow retrieving data from the device 0 – Not allow retrieving data from the device |
POST | Number | { 0, 1 } | 1 – Allow changing device settings 0 – Not allow changing device settings |
cURL Example
> curl -c cookies.txt -H "Content-Type: application/json" -X POST -d '{"username":"user","password":"pass"}'http://192.168.1.1/api/login { "stat": "ok", "response": { "permission": { "GET": 1, "POST": 1 } } }