GetArtifact - Retrieve a single artifact
Use OpenAPI to retrieve information about a single artifact.
|
Applicable editions |
Central edition, Region edition |
Endpoint and authorization information
-
Get the endpoint: Replace {domain} in the API request syntax.
-
Get organizationId: Required for Central edition only. Go to the Basic Information page in the Organization Management console to obtain your organization ID.
|
Product |
Resource |
Required permission |
|
Artifact Repository |
Artifact |
Read-only |
Request syntax
Central edition
GET https://{domain}/oapi/v1/packages/organizations/{organizationId}/repositories/{repoId}/artifacts/{id}
Region edition
GET https://{domain}/oapi/v1/packages/repositories/{repoId}/artifacts/{id}
Request headers
|
Parameter |
Type |
Required |
Description |
Example value |
|
x-yunxiao-token |
string |
Yes |
Personal access token. |
pt-0fh3****0fbG_35af****0484 |
Request parameters
|
Parameter |
Type |
Location |
Required |
Description |
Example value |
|
organizationId |
string |
path |
|
Organization ID. |
xxxxxxxx |
|
repoId |
string |
path |
Yes |
Repository ID. |
my-repo |
|
id |
integer |
path |
Yes |
Artifact ID. See ListArtifacts - Query artifact information API for reference. |
123456 |
|
repoType |
string |
query |
Yes |
Repository type. Valid values: GENERIC, DOCKER, MAVEN, NPM, NUGET, PYPI. |
MAVEN |
Request examples
Central edition
curl -X 'GET' \
'https://{domain}/oapi/v1/packages/organizations/xxxxxxxx/repositories/my-repo/artifacts/123456?repoType=MAVEN' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'
Region edition
curl -X 'GET' \
'https://{domain}/oapi/v1/packages/repositories/my-repo/artifacts/123456?repoType=MAVEN' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'
Response parameters
|
Parameter |
Type |
Description |
Example value |
| - |
object |
Module information. |
|
|
downloadCount |
integer |
Download count. |
100 |
|
gmtDownload |
integer |
Most recent download time. |
1728557118000 |
|
id |
integer |
Artifact ID. |
123456 |
|
latestUpdate |
integer |
Most recent update time. |
1728557118000 |
|
module |
string |
Module name. |
mypackage |
|
organization |
string |
Organization information. |
com.aliyun |
|
repositoryId |
string |
Repository ID. |
my_repo |
| versions |
array |
List of versions. |
|
| - |
object |
||
|
createTime |
integer |
Creation time. |
1728557118000 |
|
creator |
string |
Creator. |
xxxx |
|
gmtDownload |
integer |
Most recent download time. |
1728557118000 |
|
id |
integer |
Artifact version ID. |
123456 |
|
modifier |
string |
Modifier. |
xxx |
|
updateTime |
integer |
Modification time. |
1728557118000 |
|
version |
string |
Version number. |
1.4 |
Response example
{
"downloadCount": 100,
"gmtDownload": 1728557118000,
"id": 123456,
"latestUpdate": 1728557118000,
"module": "mypackage",
"organization": "com.aliyun",
"repositoryId": "my_repo",
"versions": [
{
"createTime": 1728557118000,
"creator": "xxxx",
"gmtDownload": 1728557118000,
"id": 123456,
"modifier": "xxx",
"updateTime": 1728557118000,
"version": "1.4"
}
]
}
Error codes
See Error Code Center for API-related error codes.