Query skill files¶
Lists static file metadata imported with skill packs. This interface only queries the skills in the current workspace and will not fall back to system skills.
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/skills/{skill_id}/files
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First query the skill list or import the skill package] to obtain the skill ID.
Set the operation-specific values used in the request:
$SKILL_ID: Skill ID.
Request¶
curl "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/skills/$SKILL_ID/files" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The current workspace ID. |
|
string |
Yes |
Skill ID. |
Successful response¶
Returns 200 on success.
{
"code": 0,
"data": {
"items": [
{
"file_path": "references/guide.md",
"file_kind": "reference",
"media_type": "text/markdown",
"sha256": "abc123",
"size_bytes": 1024
}
],
"total": 1
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
array |
Skill package static file metadata. |
|
string |
The relative path of the file in the skill package. |
|
string |
File category. |
|
string |
File media type. |
|
string |
SHA-256 digest of the file contents. |
|
integer |
File size (bytes). |
|
integer |
Number of files. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{
"code": 3,
"message": "<错误信息>",
"details": {
"reason": "SKILL_PACKAGE_FILE_NOT_FOUND"
}
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The path parameter is invalid. |
Check workspace and skill IDs. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity does not have permission to read the skill file. |
Check workspace authorization. |
|
|
The skill does not exist, or there is no readable file for the skill. |
Check the skill ID; verify that the skill is imported from a skill pack and contains static files. |
|
|
Skill pack storage is unavailable. |
Try again later. |
Follow-up operations¶
After saving the target file identification, you can Download skill file; when you need overall skill information, Query skill details.