Pulls

上传图片。Upload images.

获取上传文件的 URL,使用 PUT 流式上传。 Get the upload URL for the file. Use PUT to initiate a streaming upload. 访问令牌调用此接口需包含以下权限。Required permissions for access token. repo-code:rw

post/{repo}/-/upload/imgs

Request

  • Base URL: https://api.cnb.cool (the document declares no server; this is the origin it was published from)
  • URL: https://api.cnb.cool/{repo}/-/upload/imgs
  • Auth: API key in header Authorization

Path parameters

repostring required

仓库。Repo.

Request body

extobject

文件扩展信息。File extension info.

namestring

文件名。File name.

sizeinteger

文件大小。File size.

Response

OK

formobject

上传表单参数。Upload form parameters.

tokenstring

后续调用 confirm 接口用的。Token for the subsequent confirm API call.

upload_urlstring

上传URL地址。Upload URL.

Example response

{
  "assets": {
    "path": "/{slug}/-/assets/xxx/xxx/xxxx-xxx.png"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.