Reference example
# Fixed reference example. Playground inputs do not update this sample.
curl --request PUT \
--url https://api.aisa.one/apis/v1/social/webhooks/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"eventTypes": [
"post.published",
"post.failed",
"post.partial"
],
"id": "whk_8Pm3Vy6Rk1Ns9Gt4Qw2Jh5"
}'curl --request PUT \
--url https://api.aisa.one/apis/v1/social/webhooks/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"eventTypes": [
"post.published",
"post.failed",
"post.partial"
],
"id": "whk_8Pm3Vy6Rk1Ns9Gt4Qw2Jh5"
}
'import requests
url = "https://api.aisa.one/apis/v1/social/webhooks/settings"
payload = {
"eventTypes": ["post.published", "post.failed", "post.partial"],
"id": "whk_8Pm3Vy6Rk1Ns9Gt4Qw2Jh5"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
eventTypes: ['post.published', 'post.failed', 'post.partial'],
id: 'whk_8Pm3Vy6Rk1Ns9Gt4Qw2Jh5'
})
};
fetch('https://api.aisa.one/apis/v1/social/webhooks/settings', 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.aisa.one/apis/v1/social/webhooks/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'eventTypes' => [
'post.published',
'post.failed',
'post.partial'
],
'id' => 'whk_8Pm3Vy6Rk1Ns9Gt4Qw2Jh5'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/social/webhooks/settings"
payload := strings.NewReader("{\n \"eventTypes\": [\n \"post.published\",\n \"post.failed\",\n \"post.partial\"\n ],\n \"id\": \"whk_8Pm3Vy6Rk1Ns9Gt4Qw2Jh5\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.aisa.one/apis/v1/social/webhooks/settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"eventTypes\": [\n \"post.published\",\n \"post.failed\",\n \"post.partial\"\n ],\n \"id\": \"whk_8Pm3Vy6Rk1Ns9Gt4Qw2Jh5\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/webhooks/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"eventTypes\": [\n \"post.published\",\n \"post.failed\",\n \"post.partial\"\n ],\n \"id\": \"whk_8Pm3Vy6Rk1Ns9Gt4Qw2Jh5\"\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "2023-11-07T05:31:56Z",
"eventTypes": [
"post.scheduled"
],
"failingSince": "2023-11-07T05:31:56Z",
"id": "<string>",
"profileFilter": [
"<string>"
],
"secret": "<string>",
"status": "<string>",
"url": "<string>"
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "never",
"retryable": true,
"type": "<string>"
}
}AIsa Social
Update a webhook endpoint
rotateSecret returns a new secret; the previous one stays valid for 24 hours.
<!-- aisa-pricing:start -->
当前未提供请求参考价格;请使用接口支持的报价功能确认费用。 最终费用以账户适用价格及实际结算为准。
<!-- aisa-pricing:end -->
PUT
https://api.aisa.one
/
apis
/
v1
/
social
/
webhooks
/
settings
Reference example
# Fixed reference example. Playground inputs do not update this sample.
curl --request PUT \
--url https://api.aisa.one/apis/v1/social/webhooks/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"eventTypes": [
"post.published",
"post.failed",
"post.partial"
],
"id": "whk_8Pm3Vy6Rk1Ns9Gt4Qw2Jh5"
}'curl --request PUT \
--url https://api.aisa.one/apis/v1/social/webhooks/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"eventTypes": [
"post.published",
"post.failed",
"post.partial"
],
"id": "whk_8Pm3Vy6Rk1Ns9Gt4Qw2Jh5"
}
'import requests
url = "https://api.aisa.one/apis/v1/social/webhooks/settings"
payload = {
"eventTypes": ["post.published", "post.failed", "post.partial"],
"id": "whk_8Pm3Vy6Rk1Ns9Gt4Qw2Jh5"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
eventTypes: ['post.published', 'post.failed', 'post.partial'],
id: 'whk_8Pm3Vy6Rk1Ns9Gt4Qw2Jh5'
})
};
fetch('https://api.aisa.one/apis/v1/social/webhooks/settings', 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.aisa.one/apis/v1/social/webhooks/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'eventTypes' => [
'post.published',
'post.failed',
'post.partial'
],
'id' => 'whk_8Pm3Vy6Rk1Ns9Gt4Qw2Jh5'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/social/webhooks/settings"
payload := strings.NewReader("{\n \"eventTypes\": [\n \"post.published\",\n \"post.failed\",\n \"post.partial\"\n ],\n \"id\": \"whk_8Pm3Vy6Rk1Ns9Gt4Qw2Jh5\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.aisa.one/apis/v1/social/webhooks/settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"eventTypes\": [\n \"post.published\",\n \"post.failed\",\n \"post.partial\"\n ],\n \"id\": \"whk_8Pm3Vy6Rk1Ns9Gt4Qw2Jh5\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/webhooks/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"eventTypes\": [\n \"post.published\",\n \"post.failed\",\n \"post.partial\"\n ],\n \"id\": \"whk_8Pm3Vy6Rk1Ns9Gt4Qw2Jh5\"\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "2023-11-07T05:31:56Z",
"eventTypes": [
"post.scheduled"
],
"failingSince": "2023-11-07T05:31:56Z",
"id": "<string>",
"profileFilter": [
"<string>"
],
"secret": "<string>",
"status": "<string>",
"url": "<string>"
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "never",
"retryable": true,
"type": "<string>"
}
}请求规范
- 方法与路径: PUT /apis/v1/social/webhooks/settings
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/social/webhooks/settings - Runtime 事实版本: 99acb5bddbedc8d3352e7c4fef86c3e6d8852c14772bcd18dbcf415237a642bd
{
"operationId": "put_aisa_social_apis_v1_social_webhooks_settings",
"method": "PUT",
"path": "/apis/v1/social/webhooks/settings",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"example": {
"eventTypes": [
"post.published",
"post.failed",
"post.partial"
],
"id": "whk_8Pm3Vy6Rk1Ns9Gt4Qw2Jh5"
},
"schema": {
"additionalProperties": false,
"properties": {
"eventTypes": {
"items": {
"enum": [
"post.scheduled",
"post.published",
"post.partial",
"post.failed",
"post.cancelled",
"post.deleted",
"post.platform.published",
"post.platform.failed",
"post.platform.deleted",
"post.tiktok.url_resolved",
"account.connected",
"account.disconnected",
"account.needs_reconnect",
"connect_session.completed",
"connect_session.failed",
null
],
"type": [
"string",
"null"
]
},
"type": [
"array",
"null"
]
},
"id": {
"type": [
"string",
"null"
]
},
"profileFilter": {
"items": {
"type": [
"string",
"null"
]
},
"type": [
"array",
"null"
]
},
"rotateSecret": {
"type": [
"boolean",
"null"
]
},
"status": {
"type": [
"string",
"null"
]
},
"url": {
"type": [
"string",
"null"
]
}
},
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"x-aisa-pricing": {
"description": "This operation does not settle a customer usage charge.",
"kind": "no_customer_charge"
},
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
费用与请求规则
当前未提供请求参考价格;请使用接口支持的报价功能确认费用。 最终费用以账户适用价格及实际结算为准。 公开参考值不是你的账户报价或最终扣费。对于支持 X-AISA-Cost-Mode: quote 的接口,执行前请针对完整请求获取免费报价;执行后通过响应费用元数据和 Usage Logs 核对结算费用。1 USD 等于 1,000,000 个整数 micro-USD。授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
可用选项:
post.scheduled, post.published, post.partial, post.failed, post.cancelled, post.deleted, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, account.connected, account.disconnected, account.needs_reconnect, connect_session.completed, connect_session.failed, null 响应
Success
可用选项:
post.scheduled, post.published, post.partial, post.failed, post.cancelled, post.deleted, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, account.connected, account.disconnected, account.needs_reconnect, connect_session.completed, connect_session.failed, null