参考
SDK 与库
每个操作都能用普通 HTTP 客户端完成,因此不需要库。官方软件包尚未发布。使用标准密钥 + 操作(key + action)API 的面板和脚本只需要新的基础 URL。
使用任意 HTTP 客户端
只需一个带表单字段的 POST,或字段名相同的 JSON 正文即可。这些示例读取你的服务。
# List the services you can order
curl -X POST https://notpanel.com/api/v3 \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "key=YOUR_API_KEY&action=services"const res = await fetch("https://notpanel.com/api/v3", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({
key: "YOUR_API_KEY",
action: "services",
}),
});
const services = await res.json();
console.log(`Found ${services.length} services`);import requests
res = requests.post(
"https://notpanel.com/api/v3",
data={"key": "YOUR_API_KEY", "action": "services"},
)
services = res.json()
print(f"Found {len(services)} services")<?php
$body = http_build_query([
'key' => 'YOUR_API_KEY',
'action' => 'services',
]);
$response = file_get_contents('https://notpanel.com/api/v3', false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Content-Type: application/x-www-form-urlencoded\r\n",
'content' => $body,
],
]));
$services = json_decode($response, true);
echo "Found " . count($services) . " services\n";
下单
下单是同样的请求,只是字段更多。request_id 使得在连接中断时可以安全地重复请求。
curl -X POST https://notpanel.com/api/v3 \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "key=YOUR_API_KEY&action=add&service=7&link=https://instagram.com/example&quantity=1000&request_id=550e8400-e29b-41d4-a716-446655440000"const res = await fetch("https://notpanel.com/api/v3", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({
key: "YOUR_API_KEY",
action: "add",
service: "7",
link: "https://instagram.com/example",
quantity: "1000",
request_id: "550e8400-e29b-41d4-a716-446655440000",
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://notpanel.com/api/v3",
data={
"key": "YOUR_API_KEY",
"action": "add",
"service": "7",
"link": "https://instagram.com/example",
"quantity": "1000",
"request_id": "550e8400-e29b-41d4-a716-446655440000",
},
)
print(res.json())<?php
$body = http_build_query([
'key' => 'YOUR_API_KEY',
'action' => 'add',
'service' => '7',
'link' => 'https://instagram.com/example',
'quantity' => '1000',
'request_id' => '550e8400-e29b-41d4-a716-446655440000',
]);
$response = file_get_contents('https://notpanel.com/api/v3', false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Content-Type: application/x-www-form-urlencoded\r\n",
'content' => $body,
'ignore_errors' => true,
],
]));
print_r(json_decode($response, true));
官方 SDK
- JavaScript SDK尚未发布
- Python SDK尚未发布
- PHP SDK尚未发布
现有的分销商 SDK
将通用的密钥 + 操作(key + action)分销商 SDK 指向 https://notpanel.com/api/v3,并保留其熟悉的核心调用。地址 /api/v1, /api/v2, /api/v3 的行为完全相同。可选的 request_id、额外字段、细水长流选项、订单详情和签名 webhook 是新增内容。如需帮助,请从以下位置提交工单 联系页面 提交工单,并附上 SDK 和调用详情——我们将兼容性回归视为 P1。
API 地址:
https://notpanel.com/api/v3想发布你自己的 SDK?
欢迎社区 SDK。本站的参考页面是权威规范——任何能针对它们正确往返的实现都是有效的 SDK。我们乐于从本页链接维护良好的社区包;请通过 support@notpanel.com 并附上链接与我们联系。