### Global Skill Installation
Source: https://github.com/ziniao-open/skill-hub/blob/main/README.md
Command to perform a global, non-interactive installation of skills.
```bash
npx skills add ziniao-open/skill-hub -y -g
```
--------------------------------
### Install Skills via CLI
Source: https://github.com/ziniao-open/skill-hub/blob/main/README.md
Commands to install all or specific skills using the skills CLI.
```bash
# 安装全部 Skill
npx skills add ziniao-open/skill-hub
# 安装指定 Skill(@ 后跟 skills/ 下的目录名)
npx skills add ziniao-open/skill-hub@ziniao-erp-api-doc
npx skills add ziniao-open/skill-hub@ziniao-sso-doc
npx skills add ziniao-open/skill-hub@ziniao-webdriver-doc
npx skills add ziniao-open/skill-hub@linkfoxai-image-tool
```
--------------------------------
### POST /startBrowser
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-webdriver-doc/reference/api-core.md
Starts a browser instance for a specific shop. Consecutive calls to this endpoint will restart the browser.
```APIDOC
## POST /startBrowser
### Description
Starts a browser instance for a specific shop. Consecutive calls to this endpoint will restart the browser.
### Method
POST
### Endpoint
http://127.0.0.1:{port}
### Request Body
- **action** (string) - Required - Must be "startBrowser"
- **browserOauth** (string) - Optional - Encrypted shop ID
- **browserId** (string) - Optional - Unencrypted shop ID
- **isHeadless** (boolean) - Optional - Enable headless mode
- **requestId** (string) - Required - Unique request identifier
### Response
#### Success Response (200)
- **statusCode** (number) - 0 for success
- **debuggingPort** (string) - Port for Selenium connection
- **mainHandle** (string) - Window handle
- **core_version** (string) - Browser core version
```
--------------------------------
### getPluginInstalled
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-webdriver-doc/reference/api-auxiliary.md
Checks if specific plugins are installed for a shop.
```APIDOC
## getPluginInstalled
### Description
Queries the installation status of plugins for a specific shop.
### Request Body
- **action** (string) - Required - "getPluginInstalled"
- **requestId** (string) - Required - Unique identifier
- **browserId** (string) - Required - Shop ID
- **duplicate** (number) - Optional - Duplicate flag
- **pluginIds** (string) - Required - Comma-separated plugin IDs
### Response
- **statusCode** (number) - 0=Success, -10000=Record not found
- **install_status** (boolean) - true=Installed, false=Not installed
```
--------------------------------
### GET /superbrowser/rest/v1/erp/security/access_rule/detail
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/access-policy-rules.md
Retrieves the detailed configuration of a specific ERP access rule.
```APIDOC
## GET /superbrowser/rest/v1/erp/security/access_rule/detail
### Description
Returns full details for a specific access rule, including associated users, roles, departments, and configurations.
### Method
GET
### Endpoint
/superbrowser/rest/v1/erp/security/access_rule/detail
### Query Parameters
- **companyId** (number) - Required - Company ID
- **ruleId** (number) - Required - Rule ID
### Response
- **data** (object) - Detailed rule object containing id, name, description, users, roles, departments, accounts, configs, effectiveTime, etc.
```
--------------------------------
### startBrowser
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-webdriver-doc/SKILL.md
Launches a specific shop window and returns the debugging port.
```APIDOC
## POST /startBrowser
### Description
Starts the browser window for a specific shop and returns the debugging port required for Selenium connection.
### Method
POST
### Parameters
#### Request Body
- **company** (string) - Required - Company identifier
- **username** (string) - Required - Username
- **password** (string) - Required - Password
- **browserOauth** (string) - Optional - Encrypted shop ID
- **browserId** (string) - Optional - Plaintext shop ID
- **action** (string) - Required - Must be "startBrowser"
- **requestId** (string) - Required - Unique request identifier
### Response
#### Success Response (200)
- **debuggingPort** (number) - Port for automation framework connection
- **core_version** (string) - Version of the browser kernel
- **core_type** (string) - Type of the browser kernel
```
--------------------------------
### startBrowser 接口请求与响应
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-webdriver-doc/reference/api-core.md
用于启动店铺窗口的请求与响应格式,包含多种配置参数。
```json
{
"company": "公司",
"username": "用户名",
"password": "密码",
"action": "startBrowser",
"browserOauth": "店铺ID(加密)",
"browserId": "店铺ID(未加密,优先取此值)",
"isHeadless": true,
"isWaitPluginUpdate": true,
"privacyMode": true,
"requestId": "全局唯一标识",
"runMode": "运行模式 1轻量/2均衡(默认)/3极速",
"pluginIdList": "id1,id2,id3",
"pluginIdType": 0,
"proxyTagFiter": "name1,name2,name3",
"cookieTypeLoad": 0,
"cookieTypeSave": 0,
"injectJsInfo": "{\"url\":\"http://...\",\"username\":\"用户名\"}",
"notPromptForDownload": 1,
"isLoadUserPlugin": true,
"windowRatio": 100,
"forceDownloadPath": "文件下载路径(绝对路径)",
"preSetting": "{\"profile.managed_default_content_settings.images\": 2}"
}
```
```json
{
"statusCode": "状态码",
"err": "异常信息",
"action": "startBrowser",
"browserOauth": "店铺ID",
"requestId": "全局唯一标识",
"LastError": "内部错误信息",
"ip": "代理IP",
"isDynamicIp": "是否动态IP",
"browserPath": "允许的下载路径",
"launcherPage": "平台默认启动页面",
"ipDetectionPage": "IP检测页地址",
"debuggingPort": "调试端口",
"reportPluginId": "报表插件id",
"duplicate": "副本标志",
"proxyTag": "当前启动的代理标志",
"proxyType": 5,
"mainHandle": "窗口句柄",
"core_version": "内核版本",
"core_type": "内核类型",
"coreVersion": "内核版本",
"coreType": "内核类型",
"downloadPath": "文件下载路径"
}
```
--------------------------------
### GET /superbrowser/rest/v1/erp/security/access_rule/account/bindable_list
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/access-policy-rules.md
Retrieves a list of accounts that can be bound to an access rule.
```APIDOC
## GET /superbrowser/rest/v1/erp/security/access_rule/account/bindable_list
### Description
Fetches a list of accounts available for binding to a rule, with optional filtering.
### Method
GET
### Endpoint
/superbrowser/rest/v1/erp/security/access_rule/account/bindable_list
### Parameters
#### Query Parameters
- **companyId** (number) - Required - 公司id
- **page** (number) - Required - 页码
- **limit** (number) - Required - 每页条数
- **ruleId** (number) - Optional - 规则id
- **platformIds** (number[]) - Optional - 平台id列表
- **tagIds** (number[]) - Optional - 标签id列表
- **accountName** (string) - Optional - 账号名称
### Response
- **data** (object) - Contains list, count, and bindAccountIds
```
--------------------------------
### GET /app/builtin/company
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-sso-doc/reference/api-guide.md
Retrieves the companyId required for various API operations.
```APIDOC
## GET /app/builtin/company
### Description
Retrieves the companyId associated with the application.
### Method
GET
### Endpoint
https://sbappstoreapi.ziniao.com/openapi-router/app/builtin/company
```
--------------------------------
### Connect to Ziniao Browser with Selenium
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-webdriver-doc/reference/framework-examples.md
Use the debugging port and core version provided by startBrowser to initialize a remote-controlled browser instance.
```python
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
# startBrowser 返回的 debuggingPort 和 core_version
debugging_port = 12345
core_version = "119.1.0.16"
# 根据 core_version 的大版本号选择对应 ChromeDriver
chrome_driver_path = "/path/to/chromedriver-119"
options = Options()
options.add_experimental_option("debuggerAddress", f"127.0.0.1:{debugging_port}")
service = Service(executable_path=chrome_driver_path)
driver = webdriver.Chrome(service=service, options=options)
# 现在可以操作店铺浏览器窗口
print(driver.title)
```
```java
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("debuggerAddress", "127.0.0.1:" + debuggingPort);
// 根据 core_version 选择对应版本 ChromeDriver
System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver-" + majorVersion);
WebDriver driver = new ChromeDriver(options);
System.out.println(driver.getTitle());
```
--------------------------------
### GET /superbrowser/rest/v1/erp/security/access_rule/list
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/access-policy-rules.md
Retrieves a paginated list of ERP access rules based on filters.
```APIDOC
## GET /superbrowser/rest/v1/erp/security/access_rule/list
### Description
Fetches a list of access rules with optional filtering by search keywords, status, or rule type.
### Method
GET
### Endpoint
/superbrowser/rest/v1/erp/security/access_rule/list
### Query Parameters
- **companyId** (number) - Required - Company ID
- **search** (string) - Optional - Search keyword
- **activeRange** (number) - Optional - 1: All sites, 2: Blacklist, 3: Whitelist
- **isActive** (number) - Optional - 0: Disabled, 1: Enabled
- **ruleListType** (number) - Optional - 0: All, 1: Account-bindable
- **accountId** (number) - Optional - Account ID (required when fetching bindable rules)
- **page** (number) - Required - Page number
- **limit** (number) - Required - Items per page
### Response
- **data.list** (array) - List of rules
- **data.count** (number) - Total count of rules
```
--------------------------------
### POST /superbrowser/rest/v1/erp/package/new
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/device-management.md
Queries the list of available device packages.
```APIDOC
## POST /superbrowser/rest/v1/erp/package/new
### Description
Queries the list of available device packages.
### Method
POST
### Endpoint
/superbrowser/rest/v1/erp/package/new
### Parameters
#### Request Body
- **companyId** (number) - Required - Company ID
```
--------------------------------
### POST /superbrowser/rest/v1/erp/store/create
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/account-crud.md
Creates new ERP accounts.
```APIDOC
## POST /superbrowser/rest/v1/erp/store/create
### Description
Creates one or more new ERP accounts.
### Method
POST
### Endpoint
/superbrowser/rest/v1/erp/store/create
### Request Body
- **companyId** (number) - Required - Company ID
- **storeData** (array) - Required - Array of account data objects
- **storeData[].name** (string) - Required - Account name
- **storeData[].username** (string) - Optional - Platform login username
- **storeData[].password** (string) - Optional - Platform login password
- **storeData[].siteId** (string) - Optional - Site ID
- **storeData[].tagIds** (number[]) - Optional - List of tag IDs (max 5)
- **proxyId** (number) - Optional - Device ID
- **enterpriseName** (string) - Optional - Enterprise short name
- **defyWarning** (string) - Optional - Ignore risk warning: 1 yes, 0 no (default 1)
### Response
#### Success Response (200)
- **data** (array) - Array of objects containing storeId, name, siteId, msg, and riskMsgList
```
--------------------------------
### GET /superbrowser/rest/v1/erp/security/access_rule/list/one_account
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/access-policy-rules.md
Retrieves a paginated list of access policies bound to a specific ERP account.
```APIDOC
## GET /superbrowser/rest/v1/erp/security/access_rule/list/one_account
### Description
Fetches the list of access policies associated with a specific account, including details like policy name, active status, and assigned users.
### Method
GET
### Endpoint
/superbrowser/rest/v1/erp/security/access_rule/list/one_account
### Parameters
#### Query Parameters
- **companyId** (number) - Required - 公司id
- **accountId** (string) - Required - 账号id
- **page** (number) - Required - 页码
- **limit** (number) - Required - 每页条数
### Response
#### Success Response (200)
- **data** (object) - Contains the list and count
- **list** (array) - Array of policy objects (id, name, activeRange, activeUser, isActive, users, urlCount, isInvalid, canDelete)
- **count** (number) - Total number of policies
```
--------------------------------
### Clean Ziniao Processes
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-webdriver-doc/SKILL.md
Commands to terminate residual Ziniao processes before starting the browser or after an abnormal exit.
```powershell
Get-Process | Where-Object { $_.ProcessName -match 'ziniao|ZiNiao' } | Stop-Process -Force
```
```bash
pkill -f ziniao || true
```
--------------------------------
### POST /linkfox-ai/image/v2/make/cutout
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/linkfoxai-image-tool/SKILL.md
Initiates an automatic image matting task.
```APIDOC
## POST /linkfox-ai/image/v2/make/cutout
### Description
Initiates an automatic image matting task for a provided image URL.
### Method
POST
### Endpoint
https://sbappstoreapi.ziniao.com/openapi-router/linkfox-ai/image/v2/make/cutout
### Parameters
#### Request Body
- **imageUrl** (string) - Required - 原图
- **subType** (integer) - Required - 抠图类型 1: 通用 2: 人像 3: 商品 9: 服饰 12: 头发 13:人脸
- **clothClass** (string) - Optional - 服饰分类,只有抠图类型=9(服饰抠图)时才会生效, 可多选,以','号分割
### Response
#### Success Response (200)
- **msg** (string) - 结果描述
- **traceId** (string) - 链路追踪id
- **code** (integer) - 结果编码 200成功 非200报错
- **data** (object) - 包含作图任务ID (id)
```
--------------------------------
### ERP-员工新增v2
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/department-staff.md
Creates a new staff member with detailed configuration.
```APIDOC
## POST /superbrowser/rest/v2/erp/staff/add
### Description
Creates a new staff member with detailed configuration.
### Method
POST
### Endpoint
/superbrowser/rest/v2/erp/staff/add
### Parameters
#### Request Body
- **companyId** (string) - Required - 公司id
- **nickname** (string) - Required - 用户账号
- **name** (string) - Required - 真实姓名
- **password** (string) - Required - 密码
- **mobile** (string) - Optional - 手机号
- **departmentIds** (string[]) - Required - 部门id数组
- **roleId** (number) - Required - 角色id
- **authDevide** (number) - Required - 设备授权方式
- **isUpdatePersonInfo** (number) - Required - 1允许修改个人信息 0不允许
- **isLimitLogin** (number) - Required - 0否 1是
- **isTwoStepVerify** (number) - Required - 0否 1是
- **authClient** (object) - Required - 登录终端控制对象
### Response
#### Success Response (200)
- **id** (string) - 用户id
- **password** (string) - 密码
```
--------------------------------
### POST /superbrowser/rest/v1/erp/proxy/purchased_package_info
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/device-management.md
Queries pricing information for purchased cloud devices.
```APIDOC
## POST /superbrowser/rest/v1/erp/proxy/purchased_package_info
### Description
Queries renewal pricing for purchased cloud platform devices.
### Method
POST
### Endpoint
/superbrowser/rest/v1/erp/proxy/purchased_package_info
### Parameters
#### Request Body
- **companyId** (number) - Required - Company ID
- **proxyId** (number) - Required - Device ID
```
--------------------------------
### POST /superbrowser/rest/v1/erp/ip/self/add/new
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/device-management.md
Adds a new self-owned device.
```APIDOC
## POST /superbrowser/rest/v1/erp/ip/self/add/new
### Description
Adds a new self-owned device configuration.
### Method
POST
### Endpoint
/superbrowser/rest/v1/erp/ip/self/add/new
### Parameters
#### Request Body
- **companyId** (string) - Required - Company ID
- **defyWarning** (number) - Required - 1 ignore risk, 0 risk prompt
- **base** (object) - Required - Base info
- **base.deviceName** (string) - Required - Device name
- **base.isDynamic** (boolean) - Required - Dynamic network status
- **proxy** (object) - Required - Proxy info
- **proxy.type** (string) - Required - 0 http, 1 https, 2 socks5, 3 ssh, 4 ssl
- **proxy.addr** (string) - Required - Proxy address
- **proxy.port** (string) - Required - Proxy port
- **proxy.username** (string) - Optional - Username
- **proxy.passwd** (string) - Optional - Password
- **proxy.isSetAccount** (number) - Required - 0 no, 1 yes
```
--------------------------------
### POST /linkfox-ai/image/v2/make/info
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/linkfoxai-image-tool/SKILL.md
Retrieves the status and results of an AI image matting task.
```APIDOC
## POST /linkfox-ai/image/v2/make/info
### Description
Retrieves the current status and output results for a specific AI image matting task ID.
### Method
POST
### Endpoint
https://sbappstoreapi.ziniao.com/openapi-router/linkfox-ai/image/v2/make/info
### Parameters
#### Request Body
- **id** (string) - Required - 作图任务ID
### Response
#### Success Response (200)
- **msg** (string) - 结果描述
- **traceId** (string) - 链路追踪id
- **code** (integer) - 结果编码 200成功 非200报错
- **data** (object) - 包含任务状态、错误信息及结果图片数组 (resultList)
```
--------------------------------
### Selenium 连接配置
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-webdriver-doc/reference/api-core.md
使用 Selenium 连接已启动的浏览器窗口。
```java
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("debuggerAddress", "127.0.0.1:" + debuggingPort);
```
--------------------------------
### POST /superbrowser/rest/v1/erp/ip/page
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/device-management.md
Queries device information with pagination.
```APIDOC
## POST /superbrowser/rest/v1/erp/ip/page
### Description
Retrieves a paginated list of devices.
### Method
POST
### Endpoint
/superbrowser/rest/v1/erp/ip/page
### Parameters
#### Request Body
- **companyId** (number) - Required - Company ID
- **ipAddr** (string) - Optional - Device address
- **page** (string) - Optional - Page number
- **limit** (string) - Optional - Items per page
```
--------------------------------
### POST /superbrowser/rest/v1/store-tag/add
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/account-tags.md
添加一个新的账号标签。
```APIDOC
## POST /superbrowser/rest/v1/store-tag/add
### Description
添加一个新的账号标签。
### Method
POST
### Endpoint
/superbrowser/rest/v1/store-tag/add
### Parameters
#### Request Body
- **companyId** (string) - Optional - 公司id
- **userId** (string) - Optional - 用户id
- **tagName** (string) - Optional - 标签名称
### Response
#### Success Response (200)
- **data** (object) - 包含 tag_id (string)
```
--------------------------------
### 使用 Python 启动 WebDriver 模式
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-webdriver-doc/reference/startup-params.md
根据操作系统类型构建命令行参数并启动浏览器进程,需确保 client_path 指向正确的执行文件。
```python
import subprocess, platform, time
client_path = "紫鸟浏览器可执行文件路径"
socket_port = 9515
is_windows = platform.system() == 'Windows'
is_mac = platform.system() == 'Darwin'
is_linux = platform.system() == 'Linux'
def start_browser():
try:
if is_windows:
cmd = [client_path,
'--run_type=web_driver',
'--ipc_type=http',
'--port=' + str(socket_port)]
elif is_mac:
cmd = ['open', '-a', client_path, '--args',
'--run_type=web_driver',
'--ipc_type=http',
'--port=' + str(socket_port)]
elif is_linux:
cmd = [client_path, '--no-sandbox',
'--run_type=web_driver',
'--ipc_type=http',
'--port=' + str(socket_port)]
else:
exit()
subprocess.Popen(cmd)
time.sleep(5)
except Exception:
import traceback
print('start browser process failed: ' + traceback.format_exc())
exit()
```
--------------------------------
### POST /linkfox-ai/image/v2/make/shopReplace
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/linkfoxai-image-tool/SKILL.md
Performs a product replacement operation on an image. This tool is intended for scenarios where a user needs to replace a product in an image with another product.
```APIDOC
## POST /linkfox-ai/image/v2/make/shopReplace
### Description
This endpoint performs a product replacement operation. It takes an original product image and a target product image to generate a new image with the product replaced.
### Method
POST
### Endpoint
https://sbappstoreapi.ziniao.com/openapi-router/linkfox-ai/image/v2/make/shopReplace
### Parameters
#### Request Body
- **imageUrl** (string) - Required - 商品原图
- **sourceImageUrl** (string) - Optional - 原图抠出来的商品图
- **targetOriginUrl** (string) - Required - 替换的目标原图
- **targetImageUrl** (string) - Optional - 替换的目标原图抠图结果
- **denoiseStrength** (string) - Optional - 生成图变化程度 默认值:0.5 越大越高 浮点数 可选范围 [0,1]
- **imageOutputWidth** (integer) - Optional - 输出尺寸 宽度 最长边不能超过4096,最短边不能低于32
- **imageOutputHeight** (integer) - Optional - 输出尺寸 高度 最长边不能超过4096,最短边不能低于32
- **outputNum** (integer) - Optional - 输出张数 取值范围:[1,4] 默认值:1
### Request Example
{
"imageUrl": "https://linkfoxai-ailab.oss-cn-shenzhen.aliyuncs.com/UPLOAD/1701144666432344064/2024/11/18/96a7a42fc965491dbc625d2db09f2478.png",
"targetOriginUrl": "https://linkfoxai-ailab.oss-cn-shenzhen.aliyuncs.com/UPLOAD/1701144666432344064/2024/11/18/9778678b4724467485346248032387ec.png"
}
### Response
#### Success Response (200)
- **msg** (string) - 结果描述
- **traceId** (string) - 链路追踪id
- **code** (integer) - 结果编码 200成功 非200报错
- **data** (object) - 包含作图任务ID
- **id** (integer) - 作图任务ID
- **msgKey** (string) - 错误编码
#### Response Example
{
"code": 200,
"data": {
"id": 12345
},
"msg": "success",
"traceId": "abc-123"
}
```
--------------------------------
### POST /superbrowser/rest/v1/store-tag/replace
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/account-tags.md
替换账号标签(全量覆盖)。
```APIDOC
## POST /superbrowser/rest/v1/store-tag/replace
### Description
替换账号标签(全量覆盖)。
### Method
POST
### Endpoint
/superbrowser/rest/v1/store-tag/replace
### Parameters
#### Request Body
- **companyId** (string) - Optional - 公司id
- **storeIds** (string[]) - Optional - 账号id列表
- **tagIds** (string[]) - Optional - 标签id列表
- **userId** (string) - Optional - 用户id
### Response
#### Success Response (200)
- **ret** (string) - 响应状态
- **msg** (string) - 响应信息
- **status** (string) - 状态码
```
--------------------------------
### getBrowserList 接口请求与响应
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-webdriver-doc/reference/api-core.md
用于获取店铺列表的请求与响应格式。
```json
{
"company": "公司",
"username": "用户名",
"password": "密码",
"action": "getBrowserList",
"requestId": "全局唯一标识"
}
```
```json
{
"statusCode": "状态码",
"err": "异常信息",
"action": "getBrowserList",
"requestId": "全局唯一标识",
"browserList": [{
"browserOauth": "店铺ID(加密)",
"browserName": "店铺名称",
"browserIp": "店铺IP",
"siteId": "店铺所属站点",
"isExpired": false,
"platform_id": "平台id",
"platform_name": "平台名称"
}]
}
```
--------------------------------
### SSO 集成全流程图
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-sso-doc/SKILL.md
展示了从获取 API Key 到通过 Schema URL 打开账号的完整集成步骤。
```mermaid
graph LR
A[创建应用
获取 API Key] --> B[获取 companyId]
B --> C[查询员工列表]
C --> D[查询用户有权限的账号]
D --> E[获取用户 openapiToken]
E --> F[Schema URL
打开账号]
```
--------------------------------
### POST /superbrowser/rest/v1/store-tag/list
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/account-tags.md
获取账号的标签列表。
```APIDOC
## POST /superbrowser/rest/v1/store-tag/list
### Description
获取账号的标签列表。
### Method
POST
### Endpoint
/superbrowser/rest/v1/store-tag/list
### Parameters
#### Request Body
- **companyId** (string) - Required - 公司id
- **storeId** (string) - Required - 店铺id
- **userId** (string) - Required - 用户id
- **withSystem** (string) - Optional - 1带系统标签 0不带(默认0)
### Response
#### Success Response (200)
- **data** (object) - 包含 id(string), name(string), is_system(string), store_count(string)
```
--------------------------------
### 查询用户账号列表 cURL 示例
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-sso-doc/reference/account-crud.md
使用 cURL 发送 POST 请求查询账号列表,需在 Header 中携带有效的 Authorization Token。
```bash
curl --location 'https://sbappstoreapi.ziniao.com/openapi-router/superbrowser/rest/v1/erp/user/stores' \
--header 'Authorization: Bearer {API_Key}' \
--header 'Content-Type: application/json' \
--data-raw '{
"companyId": "15393571083459",
"userId": "15393571087094",
"storeName": "",
"isAccurate": "",
"page": "1",
"limit": "10"
}'
```
--------------------------------
### 验证紫鸟进程清理结果
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-webdriver-doc/reference/prerequisites.md
执行清理命令后,通过此命令验证是否仍有残留的紫鸟进程。
```bash
# Windows (PowerShell) — 应无输出
Get-Process | Where-Object { $_.ProcessName -match 'ziniao|ZiNiao' }
# macOS / Linux — 应无输出
pgrep -f ziniao
```
--------------------------------
### Open Account via Schema URL
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-sso-doc/reference/client-schema.md
Opens a specific account in the Ziniao browser with optional launch URL, debugging, and download settings.
```text
superbrowser://OpenStrore?storeId=xxxxxxx&openapiToken=xxxxxxxxx&userId=xxxxxxx&lanuchUrl=aHR0cHM6Ly93d3cuYmFpZHUuY29t&autoopen=true&debuggPort=60001¬PromptForDownload=1&forceDownloadPath=Rjpc5a6J6KOF5YyF --disable-gpu start-maximized
```
--------------------------------
### applyAuth 接口请求与响应
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-webdriver-doc/reference/api-core.md
用于申请设备授权的请求与响应格式。
```json
{
"company": "公司",
"username": "用户名",
"password": "密码",
"action": "applyAuth",
"requestId": "全局唯一标识"
}
```
```json
{
"statusCode": "状态码",
"err": "异常信息",
"action": "applyAuth",
"requestId": "全局唯一标识"
}
```
--------------------------------
### 获取公司信息请求示例
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-sso-doc/reference/account-crud.md
使用 cURL 获取当前自建应用的公司信息,需在 Header 中携带有效的 API Key。
```bash
curl --location 'https://sbappstoreapi.ziniao.com/openapi-router/app/builtin/company' \
--header 'Authorization: Bearer {API_Key}'
```
--------------------------------
### updateCore - 更新内核
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-webdriver-doc/reference/api-auxiliary.md
更新浏览器内核,必须携带登录凭据。建议循环轮询调用直到返回成功。
```json
{
"company": "公司",
"username": "用户名",
"password": "密码",
"action": "updateCore",
"requestId": "全局唯一标识"
}
```
```json
{
"statusCode": "状态码",
"err": "异常信息",
"requestId": "全局唯一标识"
}
```
--------------------------------
### POST /applyAuth
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-webdriver-doc/reference/api-core.md
Requests device authorization for the specified company and user credentials.
```APIDOC
## POST /applyAuth
### Description
Requests device authorization for the specified company and user credentials.
### Method
POST
### Endpoint
http://127.0.0.1:{port}
### Request Body
- **company** (string) - Required - Company name
- **username** (string) - Required - Username
- **password** (string) - Required - Password
- **action** (string) - Required - Must be "applyAuth"
- **requestId** (string) - Required - Unique request identifier
### Response
#### Success Response (200)
- **statusCode** (number) - 0 for success
- **err** (string) - Error message if any
- **action** (string) - "applyAuth"
- **requestId** (string) - Unique request identifier
```
--------------------------------
### 查询 ERP 账号列表 cURL 示例
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-sso-doc/reference/account-crud.md
使用 cURL 发送 POST 请求以获取账号列表,需在 Header 中携带有效的 Authorization Token。
```bash
curl --location 'https://sbappstoreapi.ziniao.com/openapi-router/superbrowser/rest/v1/erp/store/list' \
--header 'Authorization: Bearer {API_Key}' \
--header 'Content-Type: application/json' \
--data-raw '{
"companyId": "15393571083459",
"storeName": "",
"ip": "",
"page": "1",
"limit": "10"
}'
```
--------------------------------
### POST /superbrowser/rest/v1/store-tag/bind
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/account-tags.md
为账号绑定标签(增量追加)。
```APIDOC
## POST /superbrowser/rest/v1/store-tag/bind
### Description
为账号绑定标签(增量追加)。
### Method
POST
### Endpoint
/superbrowser/rest/v1/store-tag/bind
### Parameters
#### Request Body
- **companyId** (string) - Optional - 公司id
- **storeIds** (string[]) - Optional - 账号id列表
- **tagIds** (string[]) - Optional - 标签id列表
- **userId** (string) - Optional - 用户id
### Response
#### Success Response (200)
- **ret** (string) - 响应状态
- **msg** (string) - 响应信息
```
--------------------------------
### POST /superbrowser/rest/v1/erp/ip/bind
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/device-management.md
Binds devices to specific accounts.
```APIDOC
## POST /superbrowser/rest/v1/erp/ip/bind
### Description
Binds a device to a list of account IDs.
### Method
POST
### Endpoint
/superbrowser/rest/v1/erp/ip/bind
### Parameters
#### Request Body
- **companyId** (number) - Required - Company ID
- **proxyId** (number) - Required - Device ID
- **storeIdList** (number[]) - Required - List of account IDs
- **defyWarning** (number) - Optional - Ignore risk: 1 yes, 0 no (default 1)
```
--------------------------------
### ERP-部门新增
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/department-staff.md
Creates a new department within a company.
```APIDOC
## POST /superbrowser/rest/v1/erp/department/add
### Description
Creates a new department within a company.
### Method
POST
### Endpoint
/superbrowser/rest/v1/erp/department/add
### Parameters
#### Request Body
- **companyId** (number) - Required - 公司id
- **name** (string) - Required - 部门名称
- **hierarchy** (string) - Required - 部门级别
- **parentId** (string) - Required - 父级部门id
### Response
#### Success Response (200)
- **data** (object) - Contains id (部门id).
```
--------------------------------
### POST /superbrowser/rest/v1/erp/purchase
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/device-management.md
Purchases new devices using available account balance.
```APIDOC
## POST /superbrowser/rest/v1/erp/purchase
### Description
Purchases new devices. Requires sufficient balance in the Ziniao account.
### Method
POST
### Endpoint
/superbrowser/rest/v1/erp/purchase
### Parameters
#### Request Body
- **companyId** (string) - Required - Company ID
- **purchase** (object) - Required - Purchase information object
- **purchase.packageId** (number) - Required - Package ID
- **purchase.periodId** (number) - Required - Duration ID (1:1 month, 2:3 months, 3:6 months, 4:12 months)
- **purchase.num** (number) - Required - Quantity (max 5 per request)
- **storeIds** (number[]) - Optional - List of account IDs to bind
```
--------------------------------
### getRunningInfo
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-webdriver-doc/reference/api-auxiliary.md
Retrieves information about currently running shops.
```APIDOC
## getRunningInfo
### Description
Returns a list of currently active shop browsers.
### Request Body
- **action** (string) - Required - "getRunningInfo"
- **requestId** (string) - Required - Unique identifier
### Response
- **statusCode** (number) - 0=Success
- **browsers** (array) - List of running browsers
```
--------------------------------
### Define postImageV2MakeShopReplace Tool
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/linkfoxai-image-tool/SKILL.md
Configuration details for the shop replacement tool, including the API endpoint and method.
```yaml
tool: postImageV2MakeShopReplace
sourceApiName: 商品替换
sourceMethod: POST
sourceOpenPath: /linkfox-ai/image/v2/make/shopReplace
requestUrl: https://sbappstoreapi.ziniao.com/openapi-router/linkfox-ai/image/v2/make/shopReplace
```
--------------------------------
### Define postImageV2UploadByBase64 Tool
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/linkfoxai-image-tool/SKILL.md
Configuration details for the image upload tool, including the source API name, method, and endpoint URL.
```yaml
tool: postImageV2UploadByBase64
sourceApiName: 图片上传
sourceMethod: POST
sourceOpenPath: /linkfox-ai/image/v2/uploadByBase64
requestUrl: https://sbappstoreapi.ziniao.com/openapi-router/linkfox-ai/image/v2/uploadByBase64
```
--------------------------------
### POST /superbrowser/rest/v1/erp/user/stores
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-sso-doc/reference/account-crud.md
查询某用户有权限的账号列表。
```APIDOC
## POST /superbrowser/rest/v1/erp/user/stores
### Description
查询某用户有权限的账号列表。
### Method
POST
### Endpoint
/superbrowser/rest/v1/erp/user/stores
### Parameters
#### Request Body
- **companyId** (number) - Required - 公司 ID
- **userId** (number) - Required - 用户 ID
- **storeName** (string) - Optional - 账号名称
- **isAccurate** (number) - Optional - 查询模式:0=模糊,1=精确(默认精确)
- **page** (number) - Optional - 页码
- **limit** (number) - Optional - 每页条数
### Response
#### Success Response (200)
- **ret** (number) - 状态码,0=成功
- **status** (string) - success / faile
- **data** (array) - 账号列表
- **count** (number) - 总条数
- **msg** (string) - 错误信息
```
--------------------------------
### 获取应用 Token 请求示例
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-sso-doc/reference/account-auth.md
使用 cURL 调用获取应用 Token 接口,需在 Header 中携带 API Key。
```bash
curl --location 'https://sbappstoreapi.ziniao.com/openapi-router/auth/get_app_token' \
--header 'Authorization: Bearer {API_Key}' \
--header 'Content-Type: application/json' \
--data-raw ''
```
--------------------------------
### OpenStrore (Open Account)
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-sso-doc/reference/client-schema.md
Opens a specific account in the Ziniao browser with optional launch parameters and debugging configurations.
```APIDOC
## superbrowser://OpenStrore
### Description
Opens a specific account in the Ziniao browser. Supports optional launch URLs, debugging ports, and download path configurations.
### Parameters
#### Required Parameters
- **storeId** (string) - Required - The account ID.
- **userId** (string) - Required - The Ziniao user ID.
- **openapiToken** (string) - Optional - Authentication token (required unless local user matches userId in v5.290/v6.25+).
#### Optional Parameters
- **lanuchUrl** (string) - Optional - Target URL to open, must be Base64 encoded.
- **autoopen** (boolean) - Optional - If true, automatically opens the launchUrl.
- **debuggPort** (integer) - Optional - Specifies the debug port number.
- **notPromptForDownload** (integer) - Optional - Set to 1 to disable download path prompts.
- **forceDownloadPath** (string) - Optional - Default download path, must be Base64 encoded.
### Request Example
superbrowser://OpenStrore?storeId=xxxxxxx&openapiToken=xxxxxxxxx&userId=xxxxxxx&lanuchUrl=aHR0cHM6Ly93d3cuYmFpZHUuY29t&autoopen=true&debuggPort=60001
```
--------------------------------
### ERP-访问规则新建
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-erp-api-doc/reference/access-policy-rules.md
用于创建一个新的访问规则,支持配置生效成员、生效账号、生效范围及具体的网页访问权限控制。
```APIDOC
## POST /superbrowser/rest/v1/erp/security/access_rule/add
### Description
创建一个新的访问规则。addIds 与 addNames 可任传其一,都传取并集。
### Method
POST
### Endpoint
/superbrowser/rest/v1/erp/security/access_rule/add
### Parameters
#### Request Body
- **companyId** (number) - Required - 公司id
- **name** (string) - Required - 规则名称
- **desc** (string) - Required - 规则描述
- **activeUser** (number) - Required - 生效成员(1除boss外所有/2指定成员/3指定部门/4指定角色)
- **userChange** (object) - Required - 指定成员对象
- **userChange.addIds** (string[]) - Optional - 新增成员id列表(空值传[])
- **userChange.addNames** (string[]) - Optional - 新增成员用户名列表
- **userChange.departmentIds** (number[]) - Optional - 指定部门列表
- **userChange.roleIds** (number[]) - Optional - 指定角色列表
- **activeAccount** (number) - Required - 生效账号(0所有/1指定)
- **accountChange** (object) - Required - 指定账号对象
- **accountChange.addIds** (string[]) - Optional - 账号id列表
- **activeRange** (string) - Required - 生效范围(1所有网站/2黑名单/3白名单)
- **configs** (array) - Required - 配置详情数组
- **configs[].urlId** (number) - Required - 网页ID(activeRange=1时传0)
- **configs[].isAccessible** (boolean) - Required - 是否可访问
- **configs[].isLog** (boolean) - Required - 是否记录日志
- **configs[].functions** (array) - Required - 操作控制配置数组
- **configs[].functions[].function** (string) - Required - clipboard/file_upload/file_download/print/console/password/mouse_click/keyboard_input
- **configs[].functions[].permission** (number) - Required - 1允许/2允许且记录/3限制且记录/6限制
- **isSkipRuleConflictCheck** (boolean) - Required - 是否跳过冲突检测
- **effectiveTime** (object) - Optional - 生效时间
- **effectiveTime.timeType** (string) - Required - 0永久 1限制时间
- **effectiveTime.startTime** (number) - Required - 开始时间戳(秒),永久填0
- **effectiveTime.endTime** (number) - Required - 结束时间戳(秒),永久填0
- **isAllowRequest** (boolean) - Optional - 是否允许申请访问(默认true)
- **shareCompanyIds** (number[]) - Optional - 合作公司id列表
- **domIds** (number[]) - Optional - dom列表
### Response
#### Success Response (200)
- **id** (number) - 新建规则的ID
```
--------------------------------
### getRunningInfo - 获取当前已开启的店铺
Source: https://github.com/ziniao-open/skill-hub/blob/main/skills/ziniao-webdriver-doc/reference/api-auxiliary.md
获取当前正在运行的店铺列表。
```json
{
"action": "getRunningInfo",
"requestId": "全局唯一标识"
}
```
```json
{
"statusCode": "状态码",
"browsers": [],
"requestId": "全局唯一标识"
}
```