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.

HTTP
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

Shell
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

workspace_id

string

Yes

The current workspace ID.

skill_id

string

Yes

Skill ID.

Successful response

Returns 200 on success.

JSON
{
  "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

code

integer

0 on success.

data.items

array

Skill package static file metadata.

data.items[].file_path

string

The relative path of the file in the skill package.

data.items[].file_kind

string

File category.

data.items[].media_type

string

File media type.

data.items[].sha256

string

SHA-256 digest of the file contents.

data.items[].size_bytes

integer

File size (bytes).

data.total

integer

Number of files.

[] after a type denotes an array. [] in a field path denotes each item in an array.

Error response

JSON
{
  "code": 3,
  "message": "<错误信息>",
  "details": {
    "reason": "SKILL_PACKAGE_FILE_NOT_FOUND"
  }
}

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

2(INVALID_ARGUMENT)

The path parameter is invalid.

Check workspace and skill IDs.

401

6(UNAUTHENTICATED)

Lack of valid identity credentials.

Check API Key.

403

5(PERMISSION_DENIED)

The current identity does not have permission to read the skill file.

Check workspace authorization.

404

3(NOT_FOUND)

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.

503

15(UNAVAILABLE)

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.

Last updated on