跳转到内容

连接云端运行环境

Request

返回正在运行的云端运行环境的连接信息。可使用返回的 cdpUrl 连接 Puppeteer、Playwright 或 Selenium 等自动化框架。

运行环境必须处于 RUNNING 状态。再次调用会生成新的桌面令牌,可能使先前的查看器会话失效。 两个返回 URL 都应视为短期凭据,请勿记录或持久化。

Bodyapplication/jsonrequired
envIdstring(EnvironmentId)^[1-9]\d*$required

Browser profile (environment) ID. Serialized as a decimal string to avoid JavaScript precision loss on 64-bit integers.

Example:"1800000000000001"
POST
/api/cloudbrowser/connect
curl -i -X POST \
  http://127.0.0.1:40000/api/cloudbrowser/connect \
  -H 'Content-Type: application/json' \
  -d '{
    "envId": "1800000000000001"
  }'

Responses

Success

Bodyapplication/json
codeintegerrequired

Return result code. 0 means success; other codes indicate exceptions.

Example:0
msgstring or nullrequired

Error message. Usually null on success.

Example:null
requestIdstring

Operation request ID. This field may be present when the request passes through the API gateway.

Example:"1d4f3ea968664593860b94b35d4ebf5e"
dataobject(CloudBrowserConnectResult)required
Response
{ "code": 0, "msg": null, "data": { "cdpUrl": "https://runtime1.morelogin.com:16167?token=c62fedaaac524e41a0f02fc4345d41cb", "accessUrl": "https://official-website.morelogin.com/browser-remote?token=eyJkZXNrdG9wVXJsIjoi...ZW52SWQiOiIyMDczMzk1NDg5NzM4OTE5OTM2In0%3D&envName=P-1267&lang=en-US" }, "requestId": "1d4f3ea968664593860b94b35d4ebf5e" }