Upload a file to the issue
POSThttps://your-domain/openapi/v2/project/issues/:issueID/attachments
Upload a file to the issue.
The attachment upload only supports local storage, and does not support methods such as Qiniu, S3, etc.
History
Version | Changes |
---|---|
v3.14.117, v3.15.26 | Added in: v3.14.117, v3.15.26 |
Request
Path Parameters
The issue ID
Query Parameters
The team ID
- multipart/form-data
Body
required
Possible values: <= 64 characters
The name of file
Possible values: <= 64 characters
The description of file
The file to upload
Responses
- 200
- 401
- 403
- 404
- 500
Request is successful
- application/json
- Schema
- Example (from schema)
Schema
data
object
The result of this request.
The error code of this request.
Error message for this request.
Error meta data for this request.
[
{
"result": "SUCCESS",
"data": {
"id": "5f1b0a3b",
"name": "1.png",
"hash": "5f1b0a3b5b3b4e0001a3b3b4",
"mime": "image/png",
"sizeByte": 123456,
"url": "https://xxx.com/1.png",
"version": 1
}
}
]
Returned if the authentication credentials are incorrect or missing.
- application/json
- Schema
- Example (from schema)
Schema
The result of this request.
The error code of this request.
Error message for this request.
{
"result": "FAIL",
"errorCode": "Unauthorized",
"errorMsg": "Access token is invalid"
}
Returns if the scope check fails.
- application/json
- Schema
- Example (from schema)
Schema
The result of this request.
The error code of this request.
Error message for this request.
{
"result": "FAIL",
"errorCode": "Forbidden",
"errorMsg": "Scope is invalid"
}
Returned if the resource object was not found.
- application/json
- Schema
- Example (from schema)
Schema
The result of this request.
The error code of this request.
Error message for this request.
{
"result": "FAIL",
"errorCode": "NotFound",
"errorMsg": "Not Found"
}
Internal Server Error.
- application/json
- Schema
- Example (from schema)
Schema
The result of this request.
The error code of this request.
Error message for this request.
{
"result": "FAIL",
"errorCode": "Internal Server Error",
"errorMsg": "Internal Server Error"
}
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X POST 'https://your-domain/openapi/v2/project/issues/:issueID/attachments' \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d ''