GetWorkitemFile - Get work item file details

Updated at:

Applicable editions

Central edition, Region edition

Service endpoints and authorization

  • Get service endpoints: Replace {domain} in the request URL.
  • Get a personal access token: Required to authenticate your requests.
  • Get the organization ID: Required only for Central edition. You can find the ID on the Basic Information page of the organization management console.

Product

Resource

Required permission

Project Collaboration

work item attachment

read-only

Request syntax

Central edition

GET https://{domain}/oapi/v1/projex/organizations/{organizationId}/workitems/{workitemId}/files/{id}

Region edition

GET https://{domain}/oapi/v1/projex/workitems/{workitemId}/files/{id}

Request headers

Header

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

The personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Location

Required

Description

Example value

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

The organization ID.

workitemId

string

path

Yes

The work item ID.

id

string

path

Yes

The file ID.

Request examples

Central edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/projex/organizations/{organizationId}/workitems/{workitemId}/files/{id}' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/projex/workitems/{workitemId}/files/{id}' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example value

(root)

object

The file details.

id

string

The file ID.

id-xxx

name

string

The file name.

name-xxx

size

integer

The file size, in bytes.

1024

suffix

string

The file extension.

.png

url

string

A temporary URL for downloading the file.

https://xxx.test.com

Response example

{
    "id": "id-xxx",
    "name": "name-xxx",
    "size": 1024,
    "suffix": ".png",
    "url": "https://xxx.test.com"
}

Error codes

For API error codes, see the Error Code Center.