Get a Skill file
curl --request GET \
--url https://api.langdock.com/skills/v1/{skillId}/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.langdock.com/skills/v1/{skillId}/files"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.langdock.com/skills/v1/{skillId}/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.langdock.com/skills/v1/{skillId}/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.langdock.com/skills/v1/{skillId}/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.langdock.com/skills/v1/{skillId}/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/skills/v1/{skillId}/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"path": "<string>",
"sizeBytes": 123,
"extension": "<string>",
"hasScript": true,
"sha256": "<string>",
"content": "<string>"
}Skills API
Skill-Datei abrufen
Rufe eine gespeicherte Skill-Datei anhand des Pfads ab
GET
/
skills
/
v1
/
{skillId}
/
files
Get a Skill file
curl --request GET \
--url https://api.langdock.com/skills/v1/{skillId}/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.langdock.com/skills/v1/{skillId}/files"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.langdock.com/skills/v1/{skillId}/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.langdock.com/skills/v1/{skillId}/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.langdock.com/skills/v1/{skillId}/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.langdock.com/skills/v1/{skillId}/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/skills/v1/{skillId}/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"path": "<string>",
"sizeBytes": 123,
"extension": "<string>",
"hasScript": true,
"sha256": "<string>",
"content": "<string>"
}Ruft eine gespeicherte Skill-Datei anhand des Pfads aus deinem Workspace ab.
Die Datei muss gültiges UTF-8 sein und darf höchstens 512 KB groß sein. Lesbare Endungen sind
Basis-URL
https://api.langdock.com/skills/v1/{skillId}/files
Dedicated DeploymentsErsetze
api.langdock.com durch <your-deployment-url>/api/public in allen Anfragen.Erforderliche Scopes
Dieser Endpoint erfordert denSKILL_API Scope.
Erfordert Viewer-Zugriff auf den Skill.
Parameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
skillId | string | Ja | UUID des abzurufenden Skills. |
path | string | Ja | Relativer Pfad der Datei im Skill, zum Beispiel references/template.md. Maximum: 255 Zeichen. Absolute Pfade, Pfade mit Laufwerksbuchstaben, Steuerzeichen und ..-Segmente werden abgelehnt. |
.md, .mdx, .txt, .py, .sh, .js, .ts, .json, .yaml, .yml, .toml, .csv, .xml, .xsd, .html, .css und .svg. Binärdateien und andere nicht unterstützte Dateien bleiben unter Skill abrufen gelistet. Dieser Endpoint gibt ihren Inhalt nicht zurück.
Beispiel
const axios = require("axios");
async function getSkillFile(skillId, path) {
const response = await axios.get(
`https://api.langdock.com/skills/v1/${skillId}/files`,
{
params: { path },
headers: {
Authorization: "Bearer YOUR_API_KEY"
}
}
);
console.log("Content:", response.data.content);
}
getSkillFile(
"550e8400-e29b-41d4-a716-446655440000",
"references/template.md"
);
Antwortformat
Erfolgsantwort (200 OK)
{
path: string;
sizeBytes: number;
extension: string;
hasScript: boolean;
sha256: string;
content: string;
}
Fehlerbehandlung
| Statuscode | Beschreibung |
|---|---|
| 400 | Ungültige Skill-ID, ungültiger Pfad, nicht unterstützter Dateityp, ungültiges UTF-8 oder Datei größer als 512 KB |
| 401 | Ungültiger oder fehlender API Key |
| 403 | Fehlender SKILL_API Scope oder kein Skills-Produktzugriff |
| 404 | Skill oder Datei nicht gefunden oder nicht zugänglich |
| 429 | Rate Limit überschritten |
| 500 | Interner Serverfehler |
Langdock blockiert bewusst Browser-basierte Anfragen, um deinen API-Schlüssel zu schützen und die Sicherheit deiner Anwendungen zu gewährleisten. Weitere Informationen findest du in unserem Guide zu Best Practices für API-Schlüssel.
Autorisierungen
API key as Bearer token. Format "Bearer YOUR_API_KEY"
Pfadparameter
UUID of the Skill.
Abfrageparameter
Relative path of the file inside the Skill.
Required string length:
1 - 255Antwort
File returned successfully
Relative path inside the Skill.
File size in bytes.
Lowercase file extension, including the leading dot.
Whether the file is a script file (.py, .sh, .js, or .ts).
Lowercase SHA-256 hash of the original file bytes.
UTF-8 file contents.
War diese Seite hilfreich?