Uploading an Attachment to a Work Item
Function
Uploads an attachment to a work item.
URI
POST /v4/projects/{project_id}/issues/{issue_id}/attachments/upload
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID |
issue_id |
Yes |
String |
Work item ID |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. Call IAM to obtain the user token (value of X-Subject-Token in the response header). |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
attachment |
Yes |
File |
Attachment file. The maximum size is 50 MB. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
id |
Integer |
ID of the associated work item |
issue_id |
Integer |
Work item ID |
project_id |
String |
Project ID |
disk_filename |
String |
Storage name on cloud disks |
file_name |
String |
File name |
size |
String |
File size |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_msg |
String |
Description |
error_code |
String |
Error Codes |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_msg |
String |
Description |
error_code |
String |
Error Codes |
Example Requests
Post https://{endpoint}/v4/projects/0792b7d26cb74bd799cbae80063dc74a/attachments/upload
Example Responses
Status code: 200
{ "id" : "1234,", "issue_id" : "1232,", "project_id" : "2c42a6d37ccc4197bf0b3dbe91be021a", "disk_filename" : "adfadsfasdfa.jpg", "file_name" : "demo.jpg", "size" : "1233" }
Status Codes
Status Code |
Description |
---|---|
200 |
|
400 |
Bad Request |
401 |
Unauthorized |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot