saveOauthUserQuota: Set OAuth user flow quota
saveOauthUserQuota: Set OAuth user flow quota
Function details
Sets the monthly flow cap (GB) for the current OAuth end user. Related to OAuth 2.0 authorization usage limits, not sub-account or device-channel resource pools.
Requires the end user's OAuth access token (
Ot_prefix) from oauthTokenV2. Do not use administrator (At_) or sub-account (St_) tokens.
Request address
https://openapi-[DataCenter].easy4ip.com/openapi/saveOauthUserQuota
Request format
HTTP POST. JSON body layout: Request conventions. Sign with Signature.
Incoming parameter description
| Parameter name | Parameter type | Required or not | Default value | Legal value | Parameter description |
|---|---|---|---|---|---|
| token | String | Yes | Ot_ prefix | End-user OAuth access token | |
| quotaGb | String | Yes | Monthly cap in GB. Use an empty string for no limit. Up to two decimal places |
Sample input
{
"system": {
"ver": "1.0",
"appId": "lcdxxxxxxxxx",
"sign": "xjhCQBoJ9hRDsCjyDcHjtDNzRZ3ZJezcawsfWeiaoxU=",
"time": 1603350473,
"nonce": "a4d59add-0f04-4b7e-9355-d1fb4e9dc22b"
},
"id": "d82a7fa7-655f-4bb8-ab75-72bb3dfa3a94",
"params": {
"token": "Ot_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"quotaGb": "100.50"
}
}
Return data field description
On success, result.data may be empty; rely on result.code.
Sample output
{
"id": "123456",
"result": {
"code": "0",
"msg": "The operation was successful."
}
}
Error codes
This method may return the codes below. See Return codes.
Gateway and auth (SN / TK / OP)
| Code | Meaning | Next step |
|---|---|---|
SN1001 | Signature error | Check sign per Development specification |
TK1002 | Token invalid or expired | Refresh accessToken |
OP1002 | Missing required parameter | Add required fields |
OP1003 | Invalid parameter | Match this page’s parameter table |
OP1009 | Permission denied | Check token and device bind/share grants |
OP1013 | Total call limit exceeded | Reduce call rate |
OP1014 | Daily per-interface limit exceeded | See Interface call limits |
DV1007 | Device offline | Wait until the device is online |
See Return codes · OP/SN/TK for the full catalog.
OAuth (OA)
| Code | Description | Next step |
|---|---|---|
| OA1005 | This API does not support OAuth user actions | Confirm the API supports OAuth user tokens; see OAuth authorization module |
| OA1007 | The OAuth appId is invalid | Use the OAuth project Access Key as system.appId and sign with the project Secret Key |
Notes
- To remove the cap, set
quotaGbto"". - After saving, call queryOauthUserQuota to read the current value.
