### 5.3 Start Browser Source: https://open.ziniao.com/docSupport/index_docId=98_1%E3%80%81%E4%BD%BF%E7%94%A8%E6%AD%A4%E5%8A%9F%E8%83%BD%E5%8F%AF%E4%BB%A5%E8%BE%BE%E5%88%B0%E7%9A%84%E7%9B%AE%E6%A0%870 Starts a shop browser instance. This action can be called repeatedly to restart a browser. Closing requires `stopBrowser`. ```APIDOC ## POST /api/browser/start ### Description Initiates the launch of a specific shop browser. Subsequent calls to this endpoint for the same shop will be treated as a restart. Use `stopBrowser` to close the instance. ### Method POST ### Endpoint /api/browser/start ### Parameters #### Request Body - **company** (string) - Required - The name of the company. - **username** (string) - Required - The username for authentication. - **password** (string) - Required - The password for authentication. - **action** (string) - Required - Must be set to "startBrowser". - **browserOauth** (string) - Required - The encrypted shop ID. - **browserId** (string) - Optional - The unencrypted shop ID. Preferred over `browserOauth` if available. Obtain via section 6.2. - **isHeadless** (boolean) - Optional - Enables headless mode. Network self-detection is required when enabled. - **isWaitPluginUpdate** (boolean) - Optional - Waits for plugin hot updates to complete (Windows Ziniao V5 only). - **privacyMode** (boolean) - Optional - Enables privacy mode. - **requestId** (string) - Required - A globally unique identifier for the request. - **runMode** (integer) - Optional - Specifies the run mode (default: 2). 1: Lightweight, 2: Balanced, 3: High-speed (Windows Ziniao V5 only). - **pluginIdList** (string) - Optional - Comma-separated list of ecological center plugin IDs to load after the shop starts. - **pluginIdType** (integer) - Optional - Type of `pluginIdList`. 0: Plugin version ID, 1: Plugin ID. - **proxyTagFiter** (string) - Optional - Proxy modes with reduced priority (Windows Ziniao V5 only). - **cookieTypeLoad** (integer) - Optional - Fixed value of 0. - **cookieTypeSave** (integer) - Optional - 0: Default, 1: Do not submit. - **injectJsInfo** (string) - Optional - JSON string containing URL and username for JavaScript injection (e.g., `{"url":"http://www.baidu.com","username":"username"}`). - **notPromptForDownload** (integer) - Optional - 1: Do not prompt, 0: Prompt. Determines whether to show a prompt for file download save paths. - **isLoadUserPlugin** (boolean) - Optional - True: Use plugins already installed for the shop; False: Use plugins provided in `pluginIdList`. - **windowRatio** (integer) - Optional - Sets the browser window size (0-100). 0: No control, 100: Full screen. - **forceDownloadPath** (string) - Optional - Absolute path for forcing download location. - **preSetting** (string) - Optional - JSON string for browser configuration, currently supports `profile.managed_default_content_settings.images` for no-image mode. ### Request Example ```json { "company": "YourCompany", "username": "your_username", "password": "your_password", "action": "startBrowser", "browserOauth": "encrypted_shop_id", "isHeadless": false, "privacyMode": true, "requestId": "unique_request_id_789" } ``` ### Response #### Success Response (200) - **statusCode** (integer) - Indicates the status of the operation (0 for success). - **err** (string) - Error message if the operation failed. - **action** (string) - The action performed ('startBrowser'). - **browserOauth** (string) - The shop ID. - **requestId** (string) - The globally unique identifier for the request. - **LastError** (string) - Internal error information. - **ip** (string) - Proxy IP address. - **isDynamicIp** (string) - Indicates if the IP is dynamic. - **browserPath** (string) - Allowed download path. - **launcherPage** (string) - Default launch page for the shop's platform. - **ipDetectionPage** (string) - IP detection page URL. - **debuggingPort** (integer) - Debugging port. - **reportPluginId** (string) - Reporting plugin ID. - **duplicate** (string) - Duplicate flag. - **proxyTag** (string) - Current proxy tag. - **proxyType** (integer) - Proxy IP type (-1: Invalid data, 0: Site group, 1: Cloud platform, 2: Own IP, 5: Local IP). - **mainHandle** (string) - Handle of the opened window. - **core_version** (string) - Kernel version. - **core_type** (string) - Kernel type. - **coreVersion** (string) - Kernel version (alias). - **coreType** (string) - Kernel type (alias). - **downloadPath** (string) - File download path. #### Response Example ```json { "statusCode": 0, "err": null, "action": "startBrowser", "browserOauth": "shop_id_abc", "requestId": "unique_request_id_789", "LastError": null, "ip": "127.0.0.1", "isDynamicIp": "false", "browserPath": "/path/to/downloads", "launcherPage": "http://example.com", "ipDetectionPage": "http://checkip.example.com", "debuggingPort": 9222, "reportPluginId": "plugin_xyz", "duplicate": "0", "proxyTag": "tag_123", "proxyType": 5, "mainHandle": "window_handle_1", "core_version": "119.0.0", "core_type": "Chromium", "coreVersion": "119.0.0", "coreType": "Chromium", "downloadPath": "/path/to/downloads" } ``` ### Status Codes - **0**: Success - **-10000**: Unknown exception - **-10001**: Kernel window creation failed - **-10002**: Invalid socket parameters - **-10003**: Login failed (requires webdriver permissions, login verification must be disabled) - **-10013**: Device authentication required - **-10004**: `browserOauth` missing - **-10006**: The `startBrowser` request from the last time for this shop has not yet finished execution. - **Positive status codes indicate specific initialization failures**: - **1**: Initialization data failed. - **2**: Detected that the current IP cannot be used normally, please contact customer service. - **4**: Timezone initialization failed. - **5**: Proxy initialization failed. - **6**: Black and white list initialization failed. - **7**: Kernel startup failed. - **8**: Browser personal directory initialization failed. - **9**: Cookies initialization failed. - **11**: Browser settings file initialization failed. - **13**: Proxy information configuration initialization failed. ``` -------------------------------- ### Start Browser Session Source: https://open.ziniao.com/docSupport/index_docId=98 Starts a shop browser session. Supports headless mode, plugin updates, and various configuration options. ```APIDOC ## POST /api/browser/start ### Description Starts a shop browser session. Subsequent calls to startBrowser are considered restarts. Closing a shop requires calling stopBrowser. ### Method POST ### Endpoint /api/browser/start ### Parameters #### Request Body - **company** (string) - Required - Company name. - **username** (string) - Required - Username. - **password** (string) - Required - Password. - **action** (string) - Required - Must be 'startBrowser'. - **browserOauth** (string) - Required - Encrypted Shop ID. - **browserId** (string) - Optional - Unencrypted Shop ID. Preferred over browserOauth. Obtainable via 'getBrowserList'. - **isHeadless** (boolean) - Optional - Enable headless mode. Defaults to false. - **isWaitPluginUpdate** (boolean) - Optional - Wait for plugin hot updates to complete (Windows Zinia V5 only). Defaults to false. - **privacyMode** (boolean) - Optional - Enable privacy mode. Defaults to false. - **requestId** (string) - Required - A globally unique identifier. - **runMode** (integer) - Optional - Run mode: 1 (Lightweight), 2 (Balanced), 3 (Express). Defaults to 2 (Windows Zinia V5 only). - **pluginIdList** (string) - Optional - Comma-separated list of plugin IDs to load after shop startup (e.g., "id1,id2,id3"). - **pluginIdType** (integer) - Optional - Type of pluginIdList: 0 for plugin version ID, 1 for plugin ID. Defaults to 0. - **proxyTagFiter** (string) - Optional - Proxy tags with lower priority (Windows Zinia V5 only). - **cookieTypeLoad** (integer) - Optional - Cookie loading type. Fixed to 0. - **cookieTypeSave** (integer) - Optional - Cookie saving type: 0 (Default), 1 (Do not submit). Defaults to 0. - **injectJsInfo** (string) - Optional - JSON string for injecting JavaScript, e.g., `{"url":"http://www.baidu.com","username":"your_username"}`. - **notPromptForDownload** (integer) - Optional - Whether to prompt for download path: 1 (No prompt), 0 (Prompt). Defaults to 1. - **isLoadUserPlugin** (boolean) - Optional - Use shop's installed plugins (true) or plugins from pluginIdList (false). Defaults to true. - **windowRatio** (integer) - Optional - Browser window size ratio (0-100). 0 means no control, 100 means full screen. Defaults to 100. - **forceDownloadPath** (string) - Optional - Absolute path for forcing file downloads. - **preSetting** (string) - Optional - JSON string for browser configuration, e.g., `{"profile.managed_default_content_settings.images": 2}` for no-image mode. ### Request Example ```json { "company": "YourCompany", "username": "your_username", "password": "your_password", "action": "startBrowser", "browserOauth": "encrypted_shop_id_abc", "isHeadless": true, "requestId": "unique-request-id-789" } ``` ### Response #### Success Response (200) - **statusCode** (integer) - Indicates the status of the operation (0 for success). - **err** (string) - Error message if the operation failed. - **action** (string) - The action performed ('startBrowser'). - **browserOauth** (string) - Shop ID. - **requestId** (string) - The unique identifier for the request. - **LastError** (string) - Internal error information. - **ip** (string) - Proxy IP address. - **isDynamicIp** (string) - Indicates if the IP is dynamic. - **browserPath** (string) - Allowed download path for the browser. - **launcherPage** (string) - Default launch page for the shop's platform. - **ipDetectionPage** (string) - IP detection page URL. - **debuggingPort** (integer) - Debugging port for Selenium connection. - **reportPluginId** (string) - Report plugin ID. - **duplicate** (integer) - Duplicate flag. - **proxyTag** (string) - Current proxy tag used. - **proxyType** (integer) - Proxy IP type (-1: Error, 0: Site Group, 1: Cloud Platform, 2: Own IP, 5: Local IP). - **mainHandle** (string) - Handle for the opened window. - **core_version** (string) - Kernel version. - **core_type** (string) - Kernel type. - **coreVersion** (string) - Kernel version (alias). - **coreType** (string) - Kernel type (alias). - **downloadPath** (string) - File download path. #### Response Example ```json { "statusCode": 0, "err": null, "action": "startBrowser", "browserOauth": "encrypted_shop_id_abc", "requestId": "unique-request-id-789", "LastError": null, "ip": "1.2.3.4", "isDynamicIp": "true", "browserPath": "/path/to/downloads", "launcherPage": "http://example.com/launch", "ipDetectionPage": "http://example.com/detect", "debuggingPort": 9222, "reportPluginId": "plugin_report_1", "duplicate": 0, "proxyTag": "tag_a", "proxyType": 5, "mainHandle": "handle_123", "core_version": "119.0.0", "core_type": "Chromium", "coreVersion": "119.0.0", "coreType": "Chromium", "downloadPath": "/path/to/downloads" } ``` ### Selenium Integration To connect with Selenium, use the `debuggingPort` provided in the response. Ensure you use the correct WebDriver version matching the `core_type` and `core_version`. ```java // Example for Java with ChromeOptions ChromeOptions options = new ChromeOptions(); options.setExperimentalOption("debuggerAddress", "127.0.0.1:" + debuggingPort); // Remove other unnecessary parameters ``` ### Error Codes - 0: Success - -10000: Unknown exception - -10001: Kernel window creation failed - -10002: Illegal Socket parameters - -10003: Login failed (requires webdriver permission, login verification must be disabled) - -10013: Device authentication required - -10004: Missing browserOauth - -10006: The startBrowser request from the previous instance has not yet completed. - Positive status codes indicate specific initialization failures (e.g., 1: Initialization data failed, 2: IP unusable, 4: Timezone initialization failed, 5: Proxy initialization failed, 7: Kernel startup failed, etc.). Refer to the detailed error code list for more information. ``` -------------------------------- ### Start Browser (JSON) Source: https://open.ziniao.com/docSupport/index_docId=98 启动店铺浏览器的 API 接口。此接口支持多种参数配置,如是否无头模式、隐私模式、运行模式、插件加载、窗口尺寸等。返回结果包含状态码、异常信息、店铺 ID、代理 IP、调试端口等信息。 ```json { "company": "公司", "username": "用户名", "password": "密码", "action": "startBrowser", "browserOauth": "店铺ID 加密", "browserId": "店铺ID 未加密", "isHeadless": true, "isWaitPluginUpdate": true, "privacyMode":true, "requestId": "全局唯一标识", "runMode": "运行模式,默认值2,1 轻量模式2 均衡模式 3 极速模式", "pluginIdList":"id1,id2,id3", "pluginIdType":0, "proxyTagFiter":"name1,name2,name3", "cookieTypeLoad":0, "cookieTypeSave":0, "injectJsInfo":"{\"url\":\"http://www.baidu.com\",\"username\":\"用户名\"}", "notPromptForDownload":1, "isLoadUserPlugin":true, "windowRatio":100, "forceDownloadPath":"文件下载路径", "preSetting":"{\"profile.managed_default_content_settings.images\": 2}" } ``` -------------------------------- ### Start Browser with Selenium (Java) Source: https://open.ziniao.com/docSupport/index_docId=98 使用 Selenium 启动浏览器进行连接的 Java 代码示例。根据 startBrowser 接口返回的调试端口,配置 ChromeOptions 来连接到已启动的浏览器实例。需要根据返回的 core_type 和 core_version 选择合适的 WebDriver。 ```java //根据startBrowser返回结果启动Selenium ChromeOptions options = new ChromeOptions(); //调试端口 options.setExperimentalOption("debuggerAddress", "127.0.0.1:" + debuggingPort); //删除其他不需要参数 ``` -------------------------------- ### POST /websites/open_ziniao_docsupport/getPluginInstalled Source: https://open.ziniao.com/docSupport/index_docId=98_1%E3%80%81%E4%BD%BF%E7%94%A8%E6%AD%A4%E5%8A%9F%E8%83%BD%E5%8F%AF%E4%BB%A5%E8%BE%BE%E5%88%B0%E7%9A%84%E7%9B%AE%E6%A0%870 Checks if the plugin installation for a specified shop has been notified to the frontend. ```APIDOC ## POST /websites/open_ziniao_docsupport/getPluginInstalled ### Description Checks if the plugin installation for a specified shop has been notified to the frontend. ### Method POST ### Endpoint /websites/open_ziniao_docsupport/getPluginInstalled ### Parameters #### Request Body - **action** (string) - Required - Must be "getPluginInstalled" - **requestId** (string) - Required - Global unique identifier - **browserId** (string) - Required - Shop ID - **duplicate** (integer) - Optional - Duplicate flag, defaults to 0. - **pluginIds** (string) - Required - Comma-separated plugin IDs. ### Request Example ```json { "action": "getPluginInstalled", "requestId": "your_unique_request_id", "browserId": "shop_id", "duplicate": 0, "pluginIds": "plugin_id_1,plugin_id_2" } ``` ### Response #### Success Response (200) - **statusCode** (string) - Status code. - **statusMsg** (string) - Specific message about the status. - **err** (string) - Error message. - **action** (string) - The action performed, "getPluginInstalled". - **requestId** (string) - Global unique identifier. - **install_status** (boolean) - True if installation has been notified, false otherwise. #### Response Example ```json { "statusCode": "0", "statusMsg": "", "err": null, "action": "getPluginInstalled", "requestId": "your_unique_request_id", "install_status": true } ``` ### Status Codes - 0: Success - -10000: Record not found ``` -------------------------------- ### Action: getPluginInstalled Source: https://open.ziniao.com/docSupport/index_docId=98 Checks if the front-end has been notified to install a plugin for a specified shop. ```APIDOC ## POST /action/getPluginInstalled ### Description Checks if the front-end has been notified to install a plugin for a specified shop. ### Method POST ### Endpoint /action/getPluginInstalled ### Parameters #### Request Body - **action** (string) - Required - Must be "getPluginInstalled" - **requestId** (string) - Required - A globally unique identifier - **browserId** (string) - Required - Shop ID - **duplicate** (integer) - Optional - Duplicate flag (0 is default) - **pluginIds** (string) - Required - Comma-separated plugin IDs ### Request Example ```json { "action": "getPluginInstalled ", "requestId": "your_unique_request_id" , "browserId": "your_shop_id", "duplicate": 0 , "pluginIds": "plugin_id_1,plugin_id_2" } ``` ### Response #### Success Response (200) - **statusCode** (integer) - Status code (0 for success) - **statusMsg** (string) - Specific description of the status - **err** (string) - Error message - **action** (string) - The action performed (" getPluginInstalled ") - **requestId** (string) - The globally unique identifier - **install_status** (boolean) - True if notification sent, false otherwise #### Response Example ```json { "statusCode": 0, "statusMsg": "Plugin installation status checked.", "err": null, "action": " getPluginInstalled ", "requestId": "your_unique_request_id", "install_status": true } ``` #### Error Codes - **0**: Success - **-10000**: Record not found ``` -------------------------------- ### Start ZiXun Browser with WebDriver (Python) Source: https://open.ziniao.com/docSupport/index_docId=98 This Python code snippet demonstrates how to start the ZiXun browser client in WebDriver mode using subprocess.Popen. It dynamically constructs the command based on the operating system (Windows or macOS) and includes essential arguments like run type, IPC type, and port number. A short delay is included to allow the browser to initialize. ```python import subprocess import platform import time is_windows = platform.system() == 'Windows' is_mac = platform.system() == 'Darwin' def start_browser(client_path, socket_port): """ Starts the ZiXun client in WebDriver mode. :param client_path: The absolute path to the ZiXun client executable. :param socket_port: The port number for socket communication. :return: None """ 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)] else: print('Unsupported operating system') return subprocess.Popen(cmd) time.sleep(5) # Allow time for the browser to start print(f"ZiXun browser started on port {socket_port}") except Exception as e: print(f'start browser process failed: {e}') ``` -------------------------------- ### Start ZiXun Browser with WebDriver (JavaScript) Source: https://open.ziniao.com/docSupport/index_docId=98 This JavaScript code snippet shows how to launch the ZiXun browser client in WebDriver mode using Node.js's child_process module. It utilizes util.promisify for cleaner async/await syntax and adapts the command based on the operating system (Windows or macOS). A delay is implemented to ensure the browser has sufficient time to initialize after execution. ```javascript const childProcess = require('child_process'); const util = require('util'); const os = require('os'); const execFile = util.promisify(childProcess.execFile); const is_windows = os.platform() === 'win32'; const is_mac = os.platform() === 'darwin'; async function startBrowser(clientPath, socketPort) { try { if (is_windows) { const cmd = [clientPath, '--run_type=web_driver', '--ipc_type=http', `--port=${socketPort}`]; await execFile(cmd[0], cmd.slice(1)); } else if (is_mac) { const cmd = ['open', '-a', clientPath, '--args', '--run_type=web_driver', '--ipc_type=http', `--port=${socketPort}`]; await execFile(cmd[0], cmd.slice(1)); } else { console.log('Unsupported operating system'); process.exit(1); } await new Promise(resolve => setTimeout(resolve, 5000)); // Allow time for the browser to start console.log(`ZiXun browser started on port ${socketPort}`); } catch (error) { console.log(`start browser process failed: ${error}`); process.exit(1); } } ``` -------------------------------- ### Get Browser List Source: https://open.ziniao.com/docSupport/index_docId=98 Retrieves a list of available shop browsers, primarily used to obtain the 'browserOauth' (Shop ID). ```APIDOC ## POST /api/browser/list ### Description Retrieves a list of shop browsers, essential for obtaining shop identifiers ('browserOauth'). Supports various Zinia client versions. ### Method POST ### Endpoint /api/browser/list ### Parameters #### Request Body - **company** (string) - Required - Company name. - **username** (string) - Required - Username. - **password** (string) - Required - Password. - **action** (string) - Required - Must be 'getBrowserList'. - **requestId** (string) - Required - A globally unique identifier. ### Request Example ```json { "company": "YourCompany", "username": "your_username", "password": "your_password", "action": "getBrowserList", "requestId": "unique-request-id-456" } ``` ### Response #### Success Response (200) - **statusCode** (integer) - Indicates the status of the operation (0 for success). - **err** (string) - Error message if the operation failed. - **action** (string) - The action performed ('getBrowserList'). - **requestId** (string) - The unique identifier for the request. - **browserList** (array) - A list of browser objects, each containing: - **browserOauth** (string) - Shop ID. - **browserName** (string) - Shop name. - **browserIp** (string) - Shop IP address. - **siteId** (string) - Site ID for the shop. - **isExpired** (boolean) - Indicates if the IP has expired. - **platform_id** (string) - Platform ID. - **platform_name** (string) - Platform name. #### Response Example ```json { "statusCode": 0, "err": null, "action": "getBrowserList", "requestId": "unique-request-id-456", "browserList": [ { "browserOauth": "shop_id_123", "browserName": "Shop Name 1", "browserIp": "192.168.1.100", "siteId": "site_abc", "isExpired": false, "platform_id": "platform_xyz", "platform_name": "Platform Name" } ] } ``` ### Error Codes - 0: Success - -10000: Unknown exception - -10002: Illegal Socket parameters - -10003: Login failed (requires webdriver permission, login verification must be disabled) - -10013: Device authentication required - -10004: Server returned an exception when fetching the shop list ``` -------------------------------- ### Start ZiXun Browser with WebDriver (JavaScript) Source: https://open.ziniao.com/docSupport/index_docId=98_1%E3%80%81%E4%BD%BF%E7%94%A8%E6%AD%A4%E5%8A%9F%E8%83%BD%E5%8F%AF%E4%BB%A5%E8%BE%BE%E5%88%B0%E7%9A%84%E7%9B%AE%E6%A0%870 This JavaScript code snippet shows how to launch the ZiXun browser client for WebDriver automation. It uses Node.js's child_process module to execute the client with specific arguments for WebDriver and HTTP IPC. The function handles both Windows and macOS environments and includes a delay for initialization. ```javascript const childProcess = require('child_process'); const util = require('util'); const os = require('os'); const execFile = util.promisify(childProcess.execFile); const is_windows = os.platform() === 'win32'; const is_mac = os.platform() === 'darwin'; async function startBrowser(clientPath, socketPort) { try { if (is_windows) { const cmd = [clientPath, '--run_type=web_driver', '--ipc_type=http', `--port=${socketPort}`]; await execFile(cmd[0], cmd.slice(1)); } else if (is_mac) { const cmd = ['open', '-a', clientPath, '--args', '--run_type=web_driver', '--ipc_type=http', `--port=${socketPort}`]; await execFile(cmd[0], cmd.slice(1)); } else { console.log('Unsupported operating system.'); process.exit(1); } await new Promise(resolve => setTimeout(resolve, 5000)); // Wait for the browser to initialize console.log('ZiXun browser started successfully.'); } catch (error) { console.log(`start browser process failed: ${error}`); process.exit(1); } } ``` -------------------------------- ### getRunningInfo: Get information about currently running shops Source: https://open.ziniao.com/docSupport/index_docId=98_1%E3%80%81%E4%BD%BF%E7%94%A8%E6%AD%A4%E5%8A%9F%E8%83%BD%E5%8F%AF%E4%BB%A5%E8%BE%BE%E5%88%B0%E7%9A%84%E7%9B%AE%E6%A0%870 This action retrieves information about all currently open shops. Supported on Windows and Mac Zinnia V5 and V6 clients. ```json { "action": "getRunningInfo", "requestId": "全局唯一标识" } ``` -------------------------------- ### getPluginInstalled: Check if a plugin has been notified for installation Source: https://open.ziniao.com/docSupport/index_docId=98_1%E3%80%81%E4%BD%BF%E7%94%A8%E6%AD%A4%E5%8A%9F%E8%83%BD%E5%8F%AF%E4%BB%A5%E8%BE%BE%E5%88%B0%E7%9A%84%E7%9B%AE%E6%A0%870 This action checks if the plugin for a specified shop has been notified to the frontend for installation. It requires the shop ID and plugin IDs. Supported on Windows and Mac Zinnia V5 and V6 clients. ```json { "action": "getPluginInstalled ", "requestId": "全局唯一标识" , "browserId": "店铺ID", "duplicate": 0 , "pluginIds": "插件id,插件id" } ``` -------------------------------- ### Get Store List (JSON) Source: https://open.ziniao.com/docSupport/index_docId=98 获取店铺列表的 API 接口,主要用于获取店铺 ID(browserOauth)。此接口需要公司、用户名、密码以及请求 ID。返回结果包含状态码、异常信息、请求 ID 以及店铺列表,每个店铺包含店铺 ID、名称、IP 等信息。 ```json { "company": "公司", "username": "用户名", "password": "密码", "action": "getBrowserList", "requestId": "全局唯一标识" } ``` -------------------------------- ### 紫鸟浏览器获取插件安装状态API Source: https://open.ziniao.com/docSupport/index_docId=98 使用 'getPluginInstalled' action 获取指定店铺插件是否已通知前端安装。请求需要提供店铺ID、插件ID以及副本标志。响应结果包含安装状态 'install_status'。支持的客户端版本包括 Windows 紫鸟 V5/V6 和 Mac 紫鸟 V6。 ```json { "action": "getPluginInstalled ", "requestId": "全局唯一标识" , "browserId": "店铺ID", "duplicate": 0 , "pluginIds": "插件id,插件id" } ``` -------------------------------- ### Action: getRunningInfo Source: https://open.ziniao.com/docSupport/index_docId=98 Retrieves information about all currently open shops. ```APIDOC ## POST /action/getRunningInfo ### Description Retrieves information about all currently open shops. ### Method POST ### Endpoint /action/getRunningInfo ### Parameters #### Request Body - **action** (string) - Required - Must be "getRunningInfo" - **requestId** (string) - Required - A globally unique identifier ### Request Example ```json { "action": "getRunningInfo", "requestId": "your_unique_request_id" } ``` ### Response #### Success Response (200) - **statusCode** (integer) - Status code (0 for success) - **browsers** (array) - An array containing information about the currently open shops - **requestId** (string) - The globally unique identifier #### Response Example ```json { "statusCode": 0, "browsers": [], "requestId": "your_unique_request_id" } ``` #### Error Codes - **0**: Success ``` -------------------------------- ### 紫鸟浏览器获取运行信息API Source: https://open.ziniao.com/docSupport/index_docId=98 使用 'getRunningInfo' action 获取当前打开的所有店铺信息。此接口仅需提供一个全局唯一标识符。响应结果中 'browsers' 字段包含当前打开店铺的详细信息。支持的客户端版本包括 Windows 紫鸟 V5/V6 和 Mac 紫鸟 V6。 ```json { "action": "getRunningInfo", "requestId": "全局唯一标识" } ``` -------------------------------- ### POST /websites/open_ziniao_docsupport/ClearOnline Source: https://open.ziniao.com/docSupport/index_docId=98_1%E3%80%81%E4%BD%BF%E7%94%A8%E6%AD%A4%E5%8A%9F%E8%83%BD%E5%8F%AF%E4%BB%A5%E8%BE%BE%E5%88%B0%E7%9A%84%E7%9B%AE%E6%A0%870 Clears online cache data. ```APIDOC ## POST /websites/open_ziniao_docsupport/ClearOnline ### Description Clears online cache data. ### Method POST ### Endpoint /websites/open_ziniao_docsupport/ClearOnline ### Parameters #### Request Body - **company** (string) - Required - Company name - **username** (string) - Required - Username - **password** (string) - Required - Password - **action** (string) - Required - Must be "ClearOnline" - **browserOauth** (string) - Required - Shop ID - **type** (integer) - Required - Cache clearing type: 1 for all cache, 2 for only cookies, 3 for only two-factor authentication cookies. Other values are invalid. - **requestId** (string) - Required - Global unique identifier ### Request Example ```json { "company": "your_company", "username": "your_username", "password": "your_password", "action": "ClearOnline", "browserOauth": "shop_id", "type": 2, "requestId": "your_unique_request_id" } ``` ### Response #### Success Response (200) - **statusCode** (string) - Status code. - **statusMsg** (string) - Specific message about the status. - **err** (string) - Error message. - **action** (string) - The action performed, "ClearOnline". - **requestId** (string) - Global unique identifier. #### Response Example ```json { "statusCode": "0", "statusMsg": "", "err": null, "action": "ClearOnline", "requestId": "your_unique_request_id" } ``` ### Status Codes - 0: Success - -10000: Record not found ``` -------------------------------- ### Action: ClearOnline Source: https://open.ziniao.com/docSupport/index_docId=98 Clears online cache data for a specific shop with various clearing options. ```APIDOC ## POST /action/ClearOnline ### Description Clears online cache data for a specific shop with various clearing options. ### Method POST ### Endpoint /action/ClearOnline ### Parameters #### Request Body - **company** (string) - Required - Company name - **username** (string) - Required - Username - **password** (string) - Required - Password - **action** (string) - Required - Must be "ClearOnline" - **browserOauth** (string) - Required - Shop ID - **type** (integer) - Required - Type of cache to clear: 1 for all, 2 for only cookies, 3 for only 2FA cookies. Other values are invalid. - **requestId** (string) - Required - A globally unique identifier ### Request Example ```json { "company": "your_company", "username": "your_username", "password": "your_password", "action": "ClearOnline", "browserOauth":"your_shop_id", "type":2, "requestId": "your_unique_request_id" } ``` ### Response #### Success Response (200) - **statusCode** (integer) - Status code (0 for success) - **statusMsg** (string) - Specific description of the status - **err** (string) - Error message - **action** (string) - The action performed ("ClearOnline") - **requestId** (string) - The globally unique identifier #### Response Example ```json { "statusCode": 0, "statusMsg": "Cache cleared successfully.", "err": null, "action": "ClearOnline", "requestId": "your_unique_request_id" } ``` #### Error Codes - **0**: Success - **-10000**: Record not found ``` -------------------------------- ### 5.1 Apply Device Authorization Source: https://open.ziniao.com/docSupport/index_docId=98_1%E3%80%81%E4%BD%BF%E7%94%A8%E6%AD%A4%E5%8A%9F%E8%83%BD%E5%8F%AF%E4%BB%A5%E8%BE%BE%E5%88%B0%E7%9A%84%E7%9B%AE%E6%A0%870 This endpoint allows you to apply for device authorization. It requires company, username, password, action, and a unique request ID. ```APIDOC ## POST /api/auth ### Description Applies for device authorization. This is a crucial step before performing other actions that require device authentication. ### Method POST ### Endpoint /api/auth ### Parameters #### Request Body - **company** (string) - Required - The name of the company. - **username** (string) - Required - The username for authentication. - **password** (string) - Required - The password for authentication. - **action** (string) - Required - Must be set to "applyAuth". - **requestId** (string) - Required - A globally unique identifier for the request. ### Request Example ```json { "company": "YourCompany", "username": "your_username", "password": "your_password", "action": "applyAuth", "requestId": "unique_request_id_123" } ``` ### Response #### Success Response (200) - **statusCode** (integer) - Indicates the status of the operation (0 for success). - **err** (string) - Error message if the operation failed. - **action** (string) - The action performed ('applyAuth'). - **requestId** (string) - The globally unique identifier for the request. #### Response Example ```json { "statusCode": 0, "err": null, "action": "applyAuth", "requestId": "unique_request_id_123" } ``` ### Status Codes - **0**: Success - **-10000**: Unknown exception - **-10002**: Invalid socket parameters - **-10003**: Apply process exception - **-10004**: Apply failed ``` -------------------------------- ### 紫鸟浏览器更新核心API Source: https://open.ziniao.com/docSupport/index_docId=98 使用 'updateCore' action 更新支持的内核。由于HTTP请求可能超时,此action适合循环调用直至成功。支持的客户端版本包括 Windows 紫鸟 V5/V6 和 Mac 紫鸟 V6。请求仅需提供一个全局唯一标识符。 ```json { "action": "updateCore", "requestId": "全局唯一标识" } ``` -------------------------------- ### Apply Device Authorization (JSON) Source: https://open.ziniao.com/docSupport/index_docId=98 申请设备授权的 API 接口。此接口用于向紫鸟平台申请设备使用权限,需要提供公司、用户名、密码、请求 ID 等信息。成功后会返回状态码、异常信息和请求 ID。 ```json { "company": "公司", "username": "用户名", "password": "密码", "action": "applyAuth", "requestId": "全局唯一标识" } ``` -------------------------------- ### Action: updateCore Source: https://open.ziniao.com/docSupport/index_docId=98 Updates the supported browser core. Designed for loop calls until success is returned due to HTTP timeout limitations. ```APIDOC ## POST /action/updateCore ### Description Updates the supported browser core. Designed for loop calls until success is returned due to HTTP timeout limitations. ### Method POST ### Endpoint /action/updateCore ### Parameters #### Request Body - **action** (string) - Required - Must be "updateCore" - **requestId** (string) - Required - A globally unique identifier ### Request Example ```json { "action": "updateCore", "requestId": "your_unique_request_id" } ``` ### Response #### Success Response (200) - **statusCode** (integer) - Status code (0 for success) - **requestId** (string) - The globally unique identifier #### Response Example ```json { "statusCode": 0, "requestId": "your_unique_request_id" } ``` #### Error Codes - **0**: Success - **-10000**: Processing ``` -------------------------------- ### 紫鸟浏览器正常退出API Source: https://open.ziniao.com/docSupport/index_docId=98 使用 'exit' action 正常退出紫鸟浏览器主进程。此操作会自动关闭已启动的店铺,并保留店铺的cookie信息。支持的客户端版本包括 Windows 紫鸟 V5/V6 和 Mac 紫鸟 V6。请求需要提供一个全局唯一标识符。 ```json { "action": "exit", "requestId": "全局唯一标识" } ``` -------------------------------- ### POST /websites/open_ziniao_docsupport/exit Source: https://open.ziniao.com/docSupport/index_docId=98_1%E3%80%81%E4%BD%BF%E7%94%A8%E6%AD%A4%E5%8A%9F%E8%83%BD%E5%8F%AF%E4%BB%A5%E8%BE%BE%E5%88%B0%E7%9A%84%E7%9B%AE%E6%A0%870 Gracefully exits the Zinnia Browser main process, automatically closing open shops and preserving their cookies. ```APIDOC ## POST /websites/open_ziniao_docsupport/exit ### Description Gracefully exits the Zinnia Browser main process, automatically closing open shops and preserving their cookies. ### Method POST ### Endpoint /websites/open_ziniao_docsupport/exit ### Parameters #### Request Body - **action** (string) - Required - Must be "exit" - **requestId** (string) - Required - Global unique identifier ### Request Example ```json { "action": "exit", "requestId": "your_unique_request_id" } ``` ### Response #### Success Response (200) - **statusCode** (string) - Status code. Returns 0 on success for Zinnia V6. - **err** (string) - Error message. Returned for Zinnia V6. - **action** (string) - The action performed, "exit". - **requestId** (string) - Global unique identifier. #### Response Example ```json { "statusCode": "0", "err": null, "action": "exit", "requestId": "your_unique_request_id" } ``` ### Status Codes - 0: Success - -10005: Logout failed ``` -------------------------------- ### Apply Device Authorization Source: https://open.ziniao.com/docSupport/index_docId=98 Applies for device authorization. This endpoint is supported on Windows and Mac versions of Zinia. ```APIDOC ## POST /api/auth/apply ### Description Applies for device authorization. Requires company, username, password, action, and a unique requestId. ### Method POST ### Endpoint /api/auth/apply ### Parameters #### Request Body - **company** (string) - Required - Company name. - **username** (string) - Required - Username. - **password** (string) - Required - Password. - **action** (string) - Required - Must be 'applyAuth'. - **requestId** (string) - Required - A globally unique identifier. ### Request Example ```json { "company": "YourCompany", "username": "your_username", "password": "your_password", "action": "applyAuth", "requestId": "unique-request-id-123" } ``` ### Response #### Success Response (200) - **statusCode** (integer) - Indicates the status of the operation (0 for success). - **err** (string) - Error message if the operation failed. - **action** (string) - The action performed ('applyAuth'). - **requestId** (string) - The unique identifier for the request. #### Response Example ```json { "statusCode": 0, "err": null, "action": "applyAuth", "requestId": "unique-request-id-123" } ``` ### Error Codes - 0: Success - -10000: Unknown exception - -10002: Illegal Socket parameters - -10003: Application process exception - -10004: Application failed ``` -------------------------------- ### Action: exit Source: https://open.ziniao.com/docSupport/index_docId=98 Gracefully exits the main ZiNiao browser process, automatically closing opened shops and preserving their cookies. ```APIDOC ## POST /action/exit ### Description Gracefully exits the main ZiNiao browser process, automatically closing opened shops and preserving their cookies. ### Method POST ### Endpoint /action/exit ### Parameters #### Request Body - **action** (string) - Required - Must be "exit" - **requestId** (string) - Required - A globally unique identifier ### Request Example ```json { "action": "exit", "requestId": "your_unique_request_id" } ``` ### Response #### Success Response (200) - **statusCode** (integer) - Status code (0 for success in V6) - **err** (string) - Error message (returned in V6) - **action** (string) - The action performed (" exit") - **requestId** (string) - The globally unique identifier #### Response Example ```json { "statusCode": 0, "err": null, "action": " exit", "requestId": "your_unique_request_id" } ``` #### Error Codes - **0**: Success - **-10005**: Logout failed ``` -------------------------------- ### 紫鸟浏览器清理本地缓存API Source: https://open.ziniao.com/docSupport/index_docId=98 使用 'ClearCache' action 清理本地缓存。此接口无需登录即可调用,支持指定清理单个或所有店铺的缓存。空值 'browserOauths' 表示删除所有本地缓存。支持的客户端版本包括 Windows 紫鸟 V5/V6 和 Mac 紫鸟 V6。 ```json { "action": "ClearCache", "browserOauths":[ "店铺id 1", "店铺id 2"], "requestId": "全局唯一标识" } ```