Service endpoint and authorization
- Get service endpoint: Replace
{domain}in the request URL. - Get personal access token.
|
Product |
Resource |
Required permission |
|
Project Collaboration |
work item attachment |
read-only |
Request syntax
Region edition
GET https://{domain}/oapi/v1/projex/workitems/{id}/attachments
Request headers
|
Parameter |
Type |
Required |
Description |
Example |
|
x-yunxiao-token |
string |
Yes |
Your personal access token. |
pt-0fh3****0fbG_35af****0484 |
Request parameters
|
Parameter |
Type |
Location |
Required |
Description |
Example |
|
id |
string |
path |
Yes |
The work item ID. |
|
Request examples
Region edition
curl -X 'GET' \
'https://{domain}/oapi/v1/projex/workitems/{id}/attachments' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'
Response parameters
|
Parameter |
Type |
Description |
Example |
| - |
array |
The attachment objects. |
|
| - |
object |
The attachment object. |
|
| creator |
object |
The user who created the attachment. |
|
| id |
string |
The user ID. |
674d96abd497cd558d68**** |
| name |
string |
The username. |
name-xxx |
| fileId |
string |
The file ID. |
985353d622cc8521793e08**** |
| fileName |
string |
The file name. |
file-name-xxx |
| gmtCreate |
string |
The time the attachment was created. |
|
| gmtModified |
string |
The time the attachment was last modified. |
|
| id |
string |
The attachment ID. |
id-xxx |
| modifier |
object |
The user who last modified the attachment. |
|
| id |
string |
The user ID. |
674d96abd497cd558d68**** |
| name |
string |
The username. |
name-xxx |
| size |
integer |
The file size in bytes. |
1024 |
| suffix |
string |
The file extension. |
.png |
| url |
string |
A temporary, time-sensitive download URL for the file. |
https://xxx.test.com |
Response example
[
{
"creator": {
"id": "674d96abd497cd558d68****",
"name": "name-xxx"
},
"fileId": "985353d622cc8521793e08****",
"fileName": "file-name-xxx",
"gmtCreate": "",
"gmtModified": "",
"id": "id-xxx",
"modifier": {
"id": "674d96abd497cd558d68****",
"name": "name-xxx"
},
"size": 1024,
"suffix": ".png",
"url": "https://xxx.test.com"
}
]
Error codes
For API error codes, see the Error Code Center.