When to use / not use
| Scenario | Approach |
|---|---|
| Need to understand the capabilities and modules of the Ziniao API | Read this Skill |
| Need to understand interface permission points in order to apply for activation | Read this Skill §Permission Point Summary |
| Need to do integration design for ERP docking | Read this Skill |
| Need to look up the detailed parameters of a certain interface | Read this Skill §Go deeper as needed, then read the reference/ file |
Level 0: Positioning and boundaries
What it is
Ziniao ERP REST API, aimed at ERP/third-party systems, authenticated through the "simple general mode" (Bearer API Key), enabling enterprise-level management of the Ziniao browser—covering five major modules: accounts, devices, access policies, role permissions, and department employees, with a total of 72 interfaces.
Capability overview
| Capability domain | Number of interfaces | Description |
|---|---|---|
| Account management | 22 | Account CRUD, authorization management, tag system, cache clearing |
| Device management | 11 | Package/device purchase and renewal, binding and unbinding, own-device management |
| Access policies | 22 | Webpage/group management, access rule CRUD, account policy binding |
| Roles and permissions | 7 | Role CRUD, permission list, user role adjustment |
| Department employees | 10 | Department CRUD/move, employee add/modify/query/enable-disable |
What it does not do (boundaries)
- Does not include OAuth authorization mode (only covers simple general mode)
- Does not include browser fingerprint configuration or window management
- Does not include billing/payment details (only includes device purchase/renewal operations)
- Does not include top-level management such as enterprise creation/cancellation
Level 1: Architecture and flow
Core concepts
API Key authentication: Create a "seller self-developed application" on the open platform and select "simple general mode" to obtain the API Key. Request header:Authorization: Bearer {API_Key}。
Two-layer response structure: Gateway layer (request_id / code / msg / data (business layer)) + business layer (ret / status / msg + business fields). Gateway code="0" reaches the business layer; business ret=0 means the operation succeeded. On failure, sub_code / sub_msg are additionally returned. Note: business data is not necessarily in the business layer's data field; for some interfaces, the business fields are directly at the root level of the business layer (see the response descriptions in each reference file).
Core ID system: companyId (Ziniao enterprise ID, required by almost all interfaces, obtainable on the right side of the open platform homepage), storeId (account ID), userId/staffId (user ID), proxyId (device ID), tagId/tid (tag ID), roleId (role ID), ruleId (rule ID).
Permission point system: Each interface belongs to a "belonging permission point"; the application must apply on the open platform to activate the corresponding permission before it can be called. Multiple interfaces can share the same permission point.
Call flow
graph LR
A[获取 API Key] --> B[申请权限点]
B --> C[构造请求头]
C --> D[POST 请求]
D --> E{网关 code=0?}
E -- 是 --> F{业务 ret=0?}
E -- 否 --> G[检查 Key/权限]
F -- 是 --> H[解析业务字段]
F -- 否 --> I[读取 msg]
Base URL:https://sbappstoreapi.ziniao.com/openapi-router
Permission point summary
The application must apply on the open platform to enable the following permission points before it can call the corresponding APIs:
| Module | Permission points to apply for |
|---|---|
| Account management | ERP-Create and delete account permission, ERP-Account view permission, ERP-Edit basic account information, ERP-Account authorization permission, ERP-Clear account authorization, ERP-Clear account cache, ERP-Query the list of accounts a user has permission for, ERP-Tag list, Account tag management permission |
| Device management | ERP-Device plan list query permission, ERP-Device purchase and renewal permission, ERP-Device binding permission, ERP-Device query, ERP-Toggle auto-renewal, ERP-Query purchased device price API, ERP-Unbind device, ERP-Add own device (New), ERP-Modify own device information (New) |
| Access policy | ERP-Web access permission (covers all 22 access policy APIs) |
| Role permission | ERP-Role add, modify permission, ERP-Role list query, ERP-Role details, ERP-Permission list |
| Department employees | ERP-Department and employee APIs, ERP-User department change |
Each reference file indicates the specific permission point attribution for each API.
Common response structure
{
"request_id": "全局请求追踪ID",
"code": "0",
"msg": "SUCCESS",
"data": {
"ret": 0,
"status": "success",
"data": [],
"msg": "",
"count": 0
}
}
Note: The location of business data varies by API. For most APIs, the business data is in
data.data, but for some APIs, the business fields are directly at the root level of the business layer (at the same level as ret/status). For example, the id and password returned by "ERP-Employee Add v2" are directly in the business layer, not in the data field. Please refer to the "response data" or "response" annotation in each reference file—an annotation of "response data" means the data is in the data field, while an annotation of "response" means the fields are at the root level of the business layer.
Environment conventions
- Request encoding: UTF-8, Content-Type: application/json
- Domain:
https://sbappstoreapi.ziniao.com/openapi-router - Almost all APIs are POST + JSON body
- Prerequisite: Create a "seller self-developed application", select "simple general mode", apply for the required permission points, and configure the IP whitelist
On-demand deep dive (Level 2 routing table)
Rule: Do not proactively load the following content. Only when you need to understand a certain detail, read the corresponding reference/ file according to the routing table.
| You need to understand | Read file |
|---|---|
| Authentication method, request construction, code examples (Java/Python/JS), common errors | reference/api-guide.md |
| Account creation/deletion/editing/list query/tag list/cache clearing | reference/account-crud.md |
| Account authorization add/delete/query/clear/authorized user list | reference/account-auth.md |
| Tag add/delete/rename/bind/unbind/replace/remove/clear/list | reference/account-tags.md |
| Device plan/purchase/renewal/bind/unbind/query/own device management | reference/device-management.md |
| Web page add/delete/edit/query/web page group management | reference/access-policy-web.md |
| Access rule create/edit/delete/enable-disable/details/member account settings | reference/access-policy-rules.md |
| Role add/edit/query/permission list/user role adjustment | reference/roles-permissions.md |
| Department add/delete/edit/query/move/employee add/edit/query/enable-disable/department change | reference/department-staff.md |