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 a JSON success envelope.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/skills/{skill_id}/files/content?path={path}
Before you call¶
First query the skill file to obtain file_path. Prepare the personal access token, target workspace ID, and skill ID that have access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$SKILL_ID: Skill ID.
Request example¶
curl -OJ "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/skills/$SKILL_ID/files/content?path=references%2Fguide.md" \
-H "X-API-Key: $AI_STUDIO_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. |
Query parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The relative path of the file in the skill package. Cannot be a directory, an absolute path, a path containing |
Successful response¶
Returns 200 and the file contents on success. The response is not a JSON envelope. The response sets the following headers:
Response header |
Description |
|---|---|
|
The actual media type of the file. |
|
|
|
Fixed to |
Error response¶
Returns JSON on error:
{
"code": 3,
"message": "<错误信息>",
"details": {
"reason": "SKILL_PACKAGE_FILE_NOT_FOUND"
}
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
|
Use the |
|
|
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 or specified file does not exist. |
Check skill ID and |
|
|
Skill pack storage is unavailable. |
Try again later. |
Follow-up operations¶
If you need to continue management after the download is completed, return to Query skill details.