Modify Window Browser
Tip
- Note: After the modifications are completed, the window needs to be reopened for it to take effect.
- 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
''
。 - 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
name | value | required | type | Explanation |
---|---|---|---|---|
Content-Type | application/json | Y | String | application/json |
Body Request parameter
Parameter Name | Required | type | Explanation |
---|---|---|---|
key | Y | number | The unique identifier of the window can be obtained in Get Window List API. |
windowName | Y | string | Custom window name (between 2 and 30 characters in length). |
ipProxySetting | Y | object | Proxy Object view. |
browserSettingInfo | Y | object | Configuration information object about the browser kernel View the detailed description of configuration objects. |
advancedSettingInfo | Y | object | Advanced configuration information object about Windows View the detailed description of configuration objects. |
openUrlArray | N | string | The 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). |
notes | N | string | The 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 Name | Required | type | Explanation |
---|---|---|---|
type | Y | string | null | Proxy type: [socks5 | https | http | null ] null is in direct connection mode and does not use a proxy. |
host | Y | string | Proxy host (within 200 characters). |
prot | Y | string | Proxy port (a positive integer string not exceeding 65535 or '' ). |
account | N | string | The agent's account (within 200 characters). |
password | N | string | The password for the proxy (within 100 characters). |
browserSettingInfo Parameter Description
Parameter Name | Required | type | Explanation |
---|---|---|---|
brand | Y | string | Kernel types and supported kernel versions can be dynamically obtained through interfaces. Click to obtain documents |
version | Y | string |
advancedSettingInfo Parameter Description
Parameter Name | Required | type | Explanation |
---|---|---|---|
webRTC | Y | string | webRTC value:[disabled | really ] |
platform | Y | string | platform value:[Win32 | MacIntel | iPhone | iPad | Android ] |
useragentMode | Y | string | useragentMode 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 code | Reason for error |
---|---|
E00 | The format of parameter (xxx) is incorrect! |
E01 | Missing parameter (xxx). |
E02 | The parameters are redundant. |
E03 | Missing parameter (xxx) in ipProxySetting. |
E04 | The parameters in ipProxySetting are redundant. |
E05 | The key must be a positive integer between 1 and 1000. |
E06 | The string length of windowName must be between 2 and 30. |
E07 | ipProxySetting.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). |
E08 | ipProxySetting.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 . |
E09 | ipProxySetting.port The proxy port must be a positive integer string, and ipProxySetting. host can only be an empty string if ipProxySetting. type isnull . |
E10 | ipProxySetting.port The proxy port cannot exceed 65535! |
E11 | ipProxySetting.account The character length of the proxy account must be less than or equal to 200 and can be an empty string. |
E12 | ipProxySetting.password The proxy password must be less than or equal to 100 characters in length and can be an empty string. |
E13 | openUrlArray The default open link must have a character length of 200 or less and can be an empty string. |
E14 | notes [Notes] The character length must be less than or equal to 20 and can be an empty string. |
E15 | The window unique identifier key does not have a corresponding window list! |