Skip to content

Modify Window Browser

Tip

  1. Note: After the modifications are completed, the window needs to be reopened for it to take effect.
  2. When the parameter value is not mandatory, the key name of the parameter also needs to be carried. For example, the values of keys such as account and password for openUrlArray, notes, and ipProxySetting need to be set to empty strings ''
  3. The criteria for determining the success of interface operations can be code=="00000"&&data. status==="success" 。

Request method and path

html
POST http://localhost:[post]/openapi/window/browser/update?ticket=[OpenApiToken]

Interface Function Description

Used to modify the preset information of the current window browser.

Request parameter

Header Request Data

namevaluerequiredtypeExplanation
Content-Typeapplication/jsonYStringapplication/json

Body Request parameter

Parameter NameRequiredtypeExplanation
keyYnumberThe unique identifier of the window can be obtained in Get Window List API.
windowNameYstringCustom window name (between 2 and 30 characters in length).
ipProxySettingYobjectProxy Object view.
browserSettingInfoYobjectConfiguration information object about the browser kernel View the detailed description of configuration objects.
advancedSettingInfoYobjectAdvanced configuration information object about Windows View the detailed description of configuration objects.
openUrlArrayNstringThe default link to open (write only one URL per line, without any modifiers added after the URL! The character length should be between 0 and 200).
notesNstringThe comment for the window (with a character length between 0 and 16).

Request parameter example

json
{
   "key": "8",
   "windowName": "bj111y",
   "ipProxySetting": {
      "type": "null",
      "host": "11",
      "port": "2324",
      "account": "",
      "password": ""
   },
   "browserSettingInfo": {
      "brand": "chrome",
      "version": "122.0.6261.95"
   },
   "advancedSettingInfo": {
      "webRTC": "really",
      "platform": "Win32",
      "useragentMode": "really"
   },
   "shouldChangeFingerprint": "true",
   "openUrlArray": "https://www.baidu.com\r\nhttps://www.51job.com",
   "notes": "窗口的备注信息"
}

Detailed explanation of parameters

ipProxySetting Parameter Description

Parameter NameRequiredtypeExplanation
typeYstring | nullProxy type: [socks5 | https| http | null]
null is in direct connection mode and does not use a proxy.
hostYstringProxy host (within 200 characters).
protYstringProxy port (a positive integer string not exceeding 65535 or '').
accountNstringThe agent's account (within 200 characters).
passwordNstringThe password for the proxy (within 100 characters).

browserSettingInfo Parameter Description

Parameter Name RequiredtypeExplanation
brandYstring Kernel types and supported kernel versions can be dynamically obtained through interfaces. Click to obtain documents
versionYstring

advancedSettingInfo Parameter Description

Parameter NameRequiredtypeExplanation
webRTCYstringwebRTC value:[disabled | really]
platformYstringplatform value:[Win32 | MacIntel| iPhone | iPad| Android]
useragentModeYstringuseragentMode value:[really | common| strict]

openUrlArray Detailed explanation of parameters

openUrlArray For string type data, the length is between 0 and 200, and multiple URLs are separated by \r\n.

Example of Interface Response Result

Successful Response Example

json
{
  "code": "00000",
  "message": "Success",
  "data": {
    "status": "success",
    "errorCode": "",
    "errorMsg": "",
    "result": {
      "theKey0fUpdate": 12
    }
  }
}

Example of failed response



Failed to call interface

When the interface response status code is not '00000', the interface call fails.
The specific reasons for interface call errors can be found in the Interface Response Status Code Information Comparison Table for querying.

json
{
  "code": "00001",
  "message": "Unknown error occurred, please provide feedback to official customer service!",
  "data": {}
}

This modification operation failed

json
{
  "code": "00000",
  "message": "Success",
  "data": {
    "status": "failed",
    "errorCode": "E05",
    "errorMsg": "The key must be a positive integer between 1 and 1000.",
    "result": {}
  }
}

Operation failure errorCode error code information comparison table

Error codeReason for error
E00The format of parameter (xxx) is incorrect!
E01Missing parameter (xxx).
E02The parameters are redundant.
E03Missing parameter (xxx) in ipProxySetting.
E04The parameters in ipProxySetting are redundant.
E05The key must be a positive integer between 1 and 1000.
E06The string length of windowName must be between 2 and 30.
E07ipProxySetting.type The proxy type must be one of socks5, https, http, or null and must be filled in (null indicates direct connection mode, i.e. no proxy is used).
E08ipProxySetting.host The character length of the proxy host must be between 1 and 200, and ipProxySetting.host can only be an empty string when ipProxySetting. type isnull.
E09ipProxySetting.port The proxy port must be a positive integer string, and ipProxySetting. host can only be an empty string if ipProxySetting. type isnull.
E10ipProxySetting.port The proxy port cannot exceed 65535!
E11ipProxySetting.account The character length of the proxy account must be less than or equal to 200 and can be an empty string.
E12ipProxySetting.password The proxy password must be less than or equal to 100 characters in length and can be an empty string.
E13openUrlArray The default open link must have a character length of 200 or less and can be an empty string.
E14notes [Notes] The character length must be less than or equal to 20 and can be an empty string.
E15The window unique identifier key does not have a corresponding window list!