1、API List
This part includes sub-accounts related API.
Following is the API list:
No | Function | Description |
---|---|---|
1 | create sub-account | Create a sub-account in B (big account) mode |
2 | get single subaccount information | Get selected sub-acount information |
3 | get sub-account information list | Get sub-account information list in different page |
4 | edit sub-account password | Edit sub-account password |
5 | edit sub-account Permission strategy | Edit sub-account Permission strategy |
6 | add sub-account permission | Add sub-account statement in Permission strategy |
7 | delete sub-account permission | Delete one device’s all statement in sub-account |
8 | get sub-account AccessToken | Get sub-account AccessToken |
9 | delete sub-account | delete sub-account |
Returned Code | Returned Infromation | Description |
---|---|---|
200 | Operation succeed | Request succeed |
10001 | Parameter error | No parameter or wrong format |
10013 | Your application has no permission to call the API | |
10002 | accessToken error or expiration | Get accessToken again |
10005 | appKey error | appKey locked |
10031 | The sub-account or the EZVIZ user has no permission | |
10032 | Sub-account not exist | |
10034 | Sub-account name already exist | |
10035 | Getting sub-account AccessToken error | |
10036 | The sub-account is frozen. | |
50000 | Operation failed | Operation failed |
1.1Create Sub-Account
Function
Create a sub-account in B (big account) mode.(sub-account functions description)
Request Address
{areaDomain}/api/lapp/ram/account/create
Request Method
POST
Request Parameters
Parameters | Type | Description | Required |
---|---|---|---|
accessToken | String | The access token got from permission | Y |
accountName | String | Sub-account name, 4-40 letters or characters | Y |
password | String | Sub-account passwordLowerCase(MD5(AppKey#Passwords plaintext)) |
Y |
LowerCase(MD5(AppKey#Passwords plaintext))
:for AppKey use MD5 encryption to # and plaintext, and transfer to lower letters
- HTTP Request Message
POST /api/lapp/ram/account/create HTTP/1.1
Host: isgpopen.ezvizlife.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.9307p5ye4yilog2f9apn82368j9g62g1-2rs1w3h0k0-092yx3m-ysd3i9cg9&accountName=test&password=5305b671da2d66785f7e6dd24c117370
- Return Data
{
"data": {
"accountId": "b3ad7ba927524b748e557572024d4ac2"
},
"code": "200",
"msg": "Operation succeeded!"
}
- Return Filed:
Filed Name | Type | Description |
---|---|---|
accountId | String | Sub-account id |
Return Code
1.2 Get Single Sub-Account Information
Function:
This port is used for access selected sub-account information.(sub-account function discerption)
Request Address
{areaDomain}/api/lapp/ram/account/get
Request Method
POST
Request Parameters
Parameter | Type | Description | Required |
---|---|---|---|
accessToken | String | The access token got from permission | Y |
accountId | String | Sub-account id | N |
accountName | String | Sub-account name | N |
If the accessToken parameter is the same type of sub-account’s AccessToken, the accountId and accountName’s parameter can be none. If not, one of them must not be none, if both of them are not none, port return accountID sub-account information.
- HTTP Request Message
POST /api/lapp/ram/account/get HTTP/1.1
Host: isgpopen.ezvizlife.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.9307p5ye4yilog2f9apn82368j9g62g1-2rs1w3h0k0-092yx3m-ysd3i9cg9&accountId=b3ad7ba927524b748e557572024d4ac2
- Return Data
{
"data": {
"accountId": "b3ad7ba927524b748e557572024d4ac2",
"accountName": "test",
"appKey": "ae1b9af9dcac4caeb88da6dbbf2dd8d5",
"accountStatus": 1,
"policy": {
"Statement": [
{
"Permission": "GET,UPDATE,REAL",
"Resource": [
"dev:469631729",
"dev:519928976",
"cam:544229080:1"
]
},
{
"Permission": "GET",
"Resource": [
"dev:470686804"
]
}
]
}
},
"code": "200",
"msg": "Operation succeeded!"
}
- Return Filed:
Filed Name | type | description |
---|---|---|
accountId | String | Sub-account id |
accountName | String | Sub-account name |
appKey | String | Sub-account belonged app’s AppKey |
accountStatus | int | Sub-account status. 0 is off, 1 is on |
policy | Policy | Sub-account permission strategy |
Policy type(Policy grammar structure):
Filed Name | Type | Description |
---|---|---|
Statement | Array[Statement] | Statement |
Statement type:
Filed Name | Type | Description |
---|---|---|
Permission | String | Permission list |
Resource | Array[String] | Resource list |
Return Code
1.3 Access Sub-account Information List
Function:
This port is used for get sub-account information in different pages(sub-account function description)
Request Address
{areaDomain}/api/lapp/ram/account/list
Request Method
POST
Request Parameters
Parameter | Type | Description | Required |
---|---|---|---|
accessToken | String | accessToken got from permission | Y |
pageStart | int | Page starts at 0 | N |
pageSize | int | Page size, default 10, max 50 | N |
- HTTP Request Message
POST /api/lapp/ram/account/get HTTP/1.1
Host: isgpopen.ezvizlife.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.9307p5ye4yilog2f9apn82368j9g62g1-2rs1w3h0k0-092yx3m-ysd3i9cg9&pageStart=0&pageSize=2
- Return Data
{
"page": {
"total": 15,
"page": 0,
"size": 2
},
"data": [
{
"accountId": "b3ad7ba927524b748e557572024d4ac2",
"accountName": "test",
"appKey": "ae1b9af9dcac4caeb88da6dbbf2dd8d5",
"accountStatus": 1,
"policy": {
"Statement": [
{
"Permission": "GET,UPDATE,REAL",
"Resource": [
"dev:469631729",
"dev:519928976",
"cam:544229080:1"
]
},
{
"Permission": "GET",
"Resource": [
"dev:470686804"
]
}
]
}
},
{
"accountId": "0058a3964698415d8a70a931faa48d78",
"accountName": "test2",
"appKey": "ae1b9af9dcac4caeb88da6dbbf2dd8d5",
"accountStatus": 1,
"policy": null
}
],
"code": "200",
"msg": "Operation succeeded!"
}
- Return Filed:
Filed Name | Type | Description |
---|---|---|
page | Page | Page information |
data | Array[Account] | Sub-account information list |
code | String | Sub-account information list |
msg | String | Operation message |
Page type
Filed Name | type | description |
---|---|---|
total | long | Total record count |
page | long | Start page |
size | long | Page size |
Account type
Filed Name | Type | Description |
---|---|---|
accountId | String | Sub-account id |
accountName | String | Sub-account name |
appKey | String | Sub account apps’ AppKey |
accountStatus | int | Sub-account status, 0 is off, 1 is on |
policy | Policy | Sub-account permission strategy |
Policy type (Policy grammar structure):
Filed Name | Type | Description |
---|---|---|
Statement | Array[Statement] | statement |
Statement type:
Filed Name | Type | Description |
---|---|---|
Permission | String | Permission list |
Resource | Array[String] | Resource list |
Return Code
1.4 Edit Current Sub-account Password
Function
This port is used for edit current sub-account password
Request Address
{areaDomain}/api/lapp/ram/account/updatePassword
Request Method
POST
Request Parameters
Parameter | Type | Description | Required |
---|---|---|---|
accessToken | String | The accessToken got from permission | Y |
accountId | String | Sub-account id | Y |
oldPassword | String | Old password ,LowerCase(MD5(AppKey#plaintext)) |
Y |
newPassword | String | New password LowerCase(MD5(AppKey#plaintext)) |
Y |
LowerCase(MD5(AppKey#plaintext))
:for AppKey use MD5 encryption to # and plaintext, and transfer to lower letters
- HTTP Request Message
POST /api/lapp/ram/account/updatePassword HTTP/1.1
Host: isgpopen.ezvizlife.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.9307p5ye4yilog2f9apn82368j9g62g1-2rs1w3h0k0-092yx3m-ysd3i9cg9&accountId=b3ad7ba927524b748e557572024d4ac2&oldPassword=5305b671da2d66785f7e6dd24c117370&newPassword=cc03e747a6afbbcbf8be7668acfebee5
- Return Data
{
"code": "200",
"msg": "Operation succeeded!"
}
Return Code
1.5 Edit Sub-account Permission Strategy
Function:
This port is used for edit mode B sub-account permission strategy
Request Address
{areaDomain}/api/lapp/ram/policy/set
Request Method
POST
Request Parameters
Parameter | Type | Description | Required |
---|---|---|---|
accessToken | String | The accessToken got from permission | Y |
accountId | String | Sub-account Id | Y |
policy | String | Permission strategy,Policy grammar sentence structure | Y |
- HTTP Request Message
POST /api/lapp/ram/policy/set HTTP/1.1
Host: isgpopen.ezvizlife.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.9307p5ye4yilog2f9apn82368j9g62g1-2rs1w3h0k0-092yx3m-ysd3i9cg9&policy=%7B%22Statement%22%3A%5B%7B%22Permission%22%3A+%22GET%2CUPDATE%2CREAL%22%2C%22Resource%22%3A%5B%22dev%3A469631729%22%2C%22dev%3A519928976%22%2C%22cam%3A544229080%3A1%22%5D%7D%5D%7D&accountId=b3ad7ba927524b748e557572024d4ac2
- Return Data
{
"code": "200",
"msg": "Operation succeed!"
}
Return Code
1.6 Add Sub-account Permission
Function:
This port is used for add sub-account statement in permission strategy
Request Address
{areaDomain}/api/lapp/ram/statement/add
Request Method
POST
Request Parameters
Parameter | Type | Description | Required |
---|---|---|---|
accessToken | String | The accessToken from permission | Y |
accountId | String | Sub-account Id | Y |
statement | String | Statement,Statement grammar structure,For example:{"Permission": "GET", "Resource": ["dev:469631729"]} | Y |
- HTTP Request Message
POST /api/lapp/ram/statement/add HTTP/1.1
Host: isgpopen.ezvizlife.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.9307p5ye4yilog2f9apn82368j9g62g1-2rs1w3h0k0-092yx3m-ysd3i9cg9&statement==%7B%22Permission%22%3A+%22GET%22%2C+%22Resource%22%3A+%5B%22dev%3A547596317%22%5D%7D&accountId=b3ad7ba927524b748e557572024d4ac2
- Return Data
{
"code": "200",
"msg": "Operation succeed!"
}
Return Code
1.7 Delete Sub-Account Permission
Function
This port is used for delete one device’s all statement in a sub-account
Request Address
{areaDomain}/api/lapp/ram/statement/delete
Request Method
POST
Request Parameters
Parameter | Type | Description | Required |
---|---|---|---|
accessToken | String | The accessToken got from permission | Y |
accountId | String | Sub-account Id | Y |
deviceSerial | String | Device serial number | Y |
- HTTP Request Message
POST /api/lapp/ram/statement/delete HTTP/1.1
Host: isgpopen.ezvizlife.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.9307p5ye4yilog2f9apn82368j9g62g1-2rs1w3h0k0-092yx3m-ysd3i9cg9&deviceSerial==547596317&accountId=b3ad7ba927524b748e557572024d4ac2
- Return Data
{
"code": "200",
"msg": "Operation succeeded!"
}
Return Code
1.8 Access Mode B Sub-Account AccessToken
Function
This port is used for access mode B sub-account accessToken
Request Address
{areaDomain}/api/lapp/ram/token/get
Request Method
POST
Request Parameters
Parameter | Type | Description | Required |
---|---|---|---|
accessToken | String | The accessToken got from permission | Y |
accountId | String | sub-account Id | Y |
- HTTP Request Message
POST /api/lapp/ram/token/get HTTP/1.1
Host: isgpopen.ezvizlife.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.9307p5ye4yilog2f9apn82368j9g62g1-2rs1w3h0k0-092yx3m-ysd3i9cg9&accountId=b3ad7ba927524b748e557572024d4ac2
- Return Data
{
"data": {
"accessToken": "ra.7jrcjmna8qnqg8d3dgnzs87m4v2dme3l-32enpqgusd-1jvdfe4-uxo15ik0s",
"expireTime": 1470810222045,
"areaDomain": "https://iusopen.ezvizlife.com"
},
"code": "200",
"msg": "Operation succeed !"
}
Return Code
1.9 Delete Sub-Account
Function
This port is used for delete sub-account
Request Address
{areaDomain}/api/lapp/ram/account/delete
Request Method
POST
Request Parameters
Parameter | Type | Description | Required |
---|---|---|---|
accessToken | String | The accessToken got from permission | Y |
accountId | String | sub-account Id | Y |
- HTTP Request Message
POST /api/lapp/ram/account/delete HTTP/1.1
Host: isgpopen.ezvizlife.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.9307p5ye4yilog2f9apn82368j9g62g1-2rs1w3h0k0-092yx3m-ysd3i9cg9&accountId=b3ad7ba927524b748e557572024d4ac2
- Return Data
{
"code": "200",
"msg": "Operation succeed !"
}
Return Code