JavaScript
import Client from 'agentlin_client';
const client = new Client({
apiKey: process.env['AGENTLIN_API_KEY'], // This is the default and can be omitted
});
const response = await client.env.deleteSession('session_id');
console.log(response);import os
from agentlin_client import Client
client = Client(
api_key=os.environ.get("AGENTLIN_API_KEY"), # This is the default and can be omitted
)
response = client.env.delete_session(
"session_id",
)
print(response)package main
import (
"context"
"fmt"
"github.com/LinXueyuanStdio/agentlin-client-go"
"github.com/LinXueyuanStdio/agentlin-client-go/option"
)
func main() {
client := agentlin.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Env.DeleteSession(context.TODO(), "session_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
curl --request DELETE \
--url https://api.linxueyuan.online/v1/env/session/{session_id} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.linxueyuan.online/v1/env/session/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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;
}HttpResponse<String> response = Unirest.delete("https://api.linxueyuan.online/v1/env/session/{session_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linxueyuan.online/v1/env/session/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Environment
Delete Session
删除指定会话
DELETE
/
env
/
session
/
{session_id}
JavaScript
import Client from 'agentlin_client';
const client = new Client({
apiKey: process.env['AGENTLIN_API_KEY'], // This is the default and can be omitted
});
const response = await client.env.deleteSession('session_id');
console.log(response);import os
from agentlin_client import Client
client = Client(
api_key=os.environ.get("AGENTLIN_API_KEY"), # This is the default and can be omitted
)
response = client.env.delete_session(
"session_id",
)
print(response)package main
import (
"context"
"fmt"
"github.com/LinXueyuanStdio/agentlin-client-go"
"github.com/LinXueyuanStdio/agentlin-client-go/option"
)
func main() {
client := agentlin.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Env.DeleteSession(context.TODO(), "session_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
curl --request DELETE \
--url https://api.linxueyuan.online/v1/env/session/{session_id} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.linxueyuan.online/v1/env/session/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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;
}HttpResponse<String> response = Unirest.delete("https://api.linxueyuan.online/v1/env/session/{session_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linxueyuan.online/v1/env/session/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Was this page helpful?
⌘I