Issues

创建附件组文件上传链接。Create asset group file upload URL.

为已有附件组生成一个新的文件附件上传 URL。asset_group_id 参数从创建附件组接口的返回值中获取。 Generate a new file asset upload URL for an existing asset group. Obtain asset_group_id from the create asset group endpoint response. 获取到 upload_url 后,请使用 HTTP PUT 方法以流式方式上传文件内容。 After obtaining upload_url, use HTTP PUT to upload file content as a stream. 上传完成后,将返回的 asset_link 引用到 Issue 内容中即可添加文件附件。 After uploading, reference the returned asset_link in Issue content to add the file attachment. 访问令牌调用此接口需包含以下权限。Required permissions for access token. repo-issue:rw

post/{repo}/-/issues/asset-groups/{asset_group_id}/file-asset-upload-url

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}/-/issues/asset-groups/{asset_group_id}/file-asset-upload-url
  • Auth: API key in header Authorization

Path parameters

repostring required

不带.git后缀的仓库名称。格式:组织名称/仓库名称。Repository name without .git suffix. Format: org/repo.

asset_group_idstring required

附件组 ID,从创建附件组接口返回值中获取。Asset group ID, obtained from the create asset group API response.

Request body

content_typestring

文件类型。File type.

namestring

文件名。必填。File name (required).

sizeinteger

文件大小,单位:字节。必须大于 0。File size in bytes. Must be greater than 0.

Response

Created

Changes

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