Cloud Browser API

Create a context

Create a context for cookies and localStorage. IndexedDB is not saved.

POST /browser/v1/contexts● Supported

Request parameters

  • projectIdstring可选

    兼容项目字段;传入值被忽略,创建结果的 projectId 固定为 default。

  • namestring可选

    登录态名称;非空时为 1–128 个 ASCII 字母、数字或 . _ : -,在当前账户内唯一;空字符串表示不设名称或清除名称。

  • labelsobject可选

    自定义字符串标签;最多 32 项,键最多 128 个 UTF-8 字节,值最多 1024 个 UTF-8 字节。

Returns

201

Errors contain statusCode, error and message; the native API adds code. The request ID is in X-Request-Id. Errors

Connection guide

Response

HTTP 201

请求成功。

application/json

NameTypeDescription
idstring登录态 ID;使用创建或列出登录态返回的 id,以 bsc_ 开头。
projectIdstring兼容项目标识,当前账户的登录态固定返回 default。
createdAtstring登录态创建时刻,UTC ISO 8601 时间。
updatedAtstring登录态名称、标签或保存内容最近一次更新的时刻,UTC ISO 8601 时间。
namestring登录态名称;非空时为 1–128 个 ASCII 字母、数字或 . _ : -,在当前账户内唯一;空字符串表示不设名称或清除名称。
labelsobject自定义字符串标签;最多 32 项,键最多 128 个 UTF-8 字节,值最多 1024 个 UTF-8 字节。
sitesarray<string>已保存的 localStorage 主机名和 cookie 域名,去掉 cookie 域名前导点后去重排序。
cookieCountinteger登录态中已保存的 cookie 条目数量;新登录态为 0。
bytesinteger登录态加密后保存内容的大小,单位为 UTF-8 字节。
lockedBystring当前登录态写入租约的持有者标识;无有效租约时省略。
lastUsedAtstring
publicKeystring
cipherAlgorithmstring
initializationVectorSizeinteger