Download skill file

Download a static file imported with the skill pack. The success response is the binary content of the file and does not use the JSON success response format.

HTTP
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/skills/{skill_id}/files/content?path={path}

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 file to obtain file_path. Prepare the personal access token, target workspace ID, and skill ID that can access the target workspace.

Request parameters

Shell
curl -OJ "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/skills/$SKILL_ID/files/content?path=references%2Fguide.md" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Path parameters

Parameter

Type

Required

Description

workspace_id

string

Yes

Current workspace ID.

skill_id

string

Yes

Skill ID.

Query parameters

Parameter

Type

Required

Description

path

string

Yes

The relative path of the file in the skill package. Maximum 1024 UTF-8 bytes. Absolute paths, backslashes, repeated slashes, trailing slashes, or independent ., .. path segments cannot be used. File names containing the .. substring will not be rejected by themselves.

Successful response

Field

Type

Description

Content-Type

response header

The actual media type of the file.

Content-Disposition

response header

attachment and provide the UTF-8 encoded file name.

X-Content-Type-Options

response header

Fixed to nosniff.

Error response

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

Returns JSON on error:

Common HTTP errors

HTTP status code

error code

Description

400

2(INVALID_ARGUMENT)

Common reasons: path The relative path to the skill pack is missing or not safe. Recommended Action: Request the file_path as-is returned by Query Skill File.

401

6(UNAUTHENTICATED)

Common Cause: Valid identity credentials are missing. Recommended Action: Check the API Key.

403

5(PERMISSION_DENIED)

Common reasons: The current identity does not have permission to read the skill file. Recommended Action: Check the workspace authorization.

404

3(NOT_FOUND)

Common reasons: The skill or specified file does not exist. Recommended Action: Check the skill ID and path.

503

15(UNAVAILABLE)

Common reasons: Skill pack storage is not available. Recommended Action: Try again later.

Last updated on