Get a prompt folder
curl --request GET \
--url https://api.langdock.com/prompts/v1/folders/{folderId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.langdock.com/prompts/v1/folders/{folderId}"
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/prompts/v1/folders/{folderId}', 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/prompts/v1/folders/{folderId}",
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/prompts/v1/folders/{folderId}"
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/prompts/v1/folders/{folderId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/prompts/v1/folders/{folderId}")
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{
"folder": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sharedWithWorkspace": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"sharedWithGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Prompt Library API
Prompt-Ordner abrufen
Rufe einen Prompt-Ordner anhand der ID aus deinem Workspace ab
GET
/
prompts
/
v1
/
folders
/
{folderId}
Get a prompt folder
curl --request GET \
--url https://api.langdock.com/prompts/v1/folders/{folderId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.langdock.com/prompts/v1/folders/{folderId}"
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/prompts/v1/folders/{folderId}', 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/prompts/v1/folders/{folderId}",
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/prompts/v1/folders/{folderId}"
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/prompts/v1/folders/{folderId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/prompts/v1/folders/{folderId}")
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{
"folder": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sharedWithWorkspace": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"sharedWithGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Ruft einen Prompt-Ordner anhand der ID aus deinem Workspace ab.
Basis-URL
https://api.langdock.com/prompts/v1/folders/{folderId}
Dedicated DeploymentsErsetze
api.langdock.com durch <your-deployment-url>/api/public in allen Anfragen.Erforderliche Scopes
Dieser Endpoint erfordert denPROMPT_API Scope.
Erfordert Zugriff über Besitz, Workspace-Freigabe oder Gruppen-Freigabe.
Parameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
folderId | string | Ja | UUID des abzurufenden Ordners. |
Beispiel
const axios = require("axios");
async function getPromptFolder(folderId) {
const response = await axios.get(
`https://api.langdock.com/prompts/v1/folders/${folderId}`,
{
headers: {
Authorization: "Bearer YOUR_API_KEY"
}
}
);
console.log("Folder:", response.data.folder);
}
getPromptFolder("7c9e6679-7425-40de-944b-e07fc1f90ae7");
Antwortformat
Erfolgsantwort (200 OK)
{
folder: {
id: string;
name: string;
createdBy: string;
sharedWithWorkspace: boolean;
sharedWithGroupId: string | null;
createdAt: string;
updatedAt: string;
};
}
Fehlerbehandlung
| Statuscode | Beschreibung |
|---|---|
| 400 | Ungültiges Ordner-ID-Format |
| 401 | Ungültiger oder fehlender API Key |
| 403 | Fehlender PROMPT_API Scope oder kein Workspace-Zugriff |
| 404 | Prompt-Ordner 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.
War diese Seite hilfreich?
⌘I