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¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First query the skill list or import the skill package to obtain the skill ID. Prepare the personal access token, target workspace ID, and skill ID that can access the target workspace.
Request parameters¶
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
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Current workspace ID. |
|
string |
Yes |
Skill ID. |
Successful response¶
{
"code": 0,
"data": {
"items": [
{
"file_path": "references/guide.md",
"file_kind": "reference",
"media_type": "text/markdown",
"sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"size_bytes": 1024
}
],
"total": 1
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
object |
The result of this request. |
|
array |
Result list. |
|
string |
Relative file path within the skill package. Can be omitted if empty or not set. |
|
string |
File category. Preferable |
|
string |
File media type. Can be omitted if empty or not set. |
|
string |
SHA-256 digest of the file contents. Can be omitted if empty or not set. |
|
integer |
File size in bytes. Can be omitted if empty or not set. |
|
integer |
The total number of matching records. |
Error response¶
{
"code": 3,
"message": "<错误信息>"
}
Common HTTP errors
HTTP status code |
error code |
Description |
|---|---|---|
|
|
Common reasons: The path parameter is invalid. Recommended Action: Check the workspace and skill IDs. |
|
|
Common Cause: Valid identity credentials are missing. Recommended Action: Check the API Key. |
|
|
Common reasons: The current identity does not have permission to read the skill file. Recommended Action: Check the workspace authorization. |
|
|
Common reasons: The skill does not exist. Recommended Action: Check the skill ID. Confirm that the skill is imported by the skill package and contains static files. |
|
|
Common reasons: Skill pack storage is not available. Recommended Action: Try again later. |