列出已註冊的 Webhook
curl --request GET \
--url https://api.ayrshare.com/api/hook/webhook \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ayrshare.com/api/hook/webhook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ayrshare.com/api/hook/webhook"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ayrshare.com/api/hook/webhook",
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.ayrshare.com/api/hook/webhook"
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.ayrshare.com/api/hook/webhook")
.header("Authorization", "Bearer <token>")
.asString();{
"batch": "https://mywebsite.com/hook",
"batchUpdated": "2024-01-11T20:05:18Z",
"feedUpdated": "2024-01-11T18:20:50Z",
"refId": "1c72bd62e59807fdfdc5cc083",
"scheduled": "https://mywebsite.com/hook",
"scheduledUpdated": "2023-12-06T01:54:08Z",
"social": "https://mywebsite.com/hook",
"socialUpdated": "2023-10-26T03:20:46Z",
"status": "success",
"updated": "2024-01-11T18:20:51Z"
}
{
"webhooks": [
{
"messages": "https://mywebsite.com/hook",
"messagesUpdated": "2024-12-11T09:58:22Z",
"refId": "d0b8bf39805ae442094137f09f2417bf2s82",
"scheduled": "https://mywebsite.com/hook",
"scheduledUpdated": "2024-02-19T12:17:12Z",
"status": "success",
"updated": "2023-08-22T11:55:06Z"
}
]
}
Webhooks
列出已註冊的 Webhook
列出已註冊的 Webhook
GET
/
hook
/
webhook
列出已註冊的 Webhook
curl --request GET \
--url https://api.ayrshare.com/api/hook/webhook \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ayrshare.com/api/hook/webhook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ayrshare.com/api/hook/webhook"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ayrshare.com/api/hook/webhook",
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.ayrshare.com/api/hook/webhook"
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.ayrshare.com/api/hook/webhook")
.header("Authorization", "Bearer <token>")
.asString();{
"batch": "https://mywebsite.com/hook",
"batchUpdated": "2024-01-11T20:05:18Z",
"feedUpdated": "2024-01-11T18:20:50Z",
"refId": "1c72bd62e59807fdfdc5cc083",
"scheduled": "https://mywebsite.com/hook",
"scheduledUpdated": "2023-12-06T01:54:08Z",
"social": "https://mywebsite.com/hook",
"socialUpdated": "2023-10-26T03:20:46Z",
"status": "success",
"updated": "2024-01-11T18:20:51Z"
}
{
"webhooks": [
{
"messages": "https://mywebsite.com/hook",
"messagesUpdated": "2024-12-11T09:58:22Z",
"refId": "d0b8bf39805ae442094137f09f2417bf2s82",
"scheduled": "https://mywebsite.com/hook",
"scheduledUpdated": "2024-02-19T12:17:12Z",
"status": "success",
"updated": "2023-08-22T11:55:06Z"
}
]
}
標頭參數
Query 參數
回傳與你帳號關聯的所有 User Profile 已註冊的 Webhook,包含 Primary Profile。
你只需在請求標頭中提供 Primary Profile 的 API Key 即可。
{
"batch": "https://mywebsite.com/hook",
"batchUpdated": "2024-01-11T20:05:18Z",
"feedUpdated": "2024-01-11T18:20:50Z",
"refId": "1c72bd62e59807fdfdc5cc083",
"scheduled": "https://mywebsite.com/hook",
"scheduledUpdated": "2023-12-06T01:54:08Z",
"social": "https://mywebsite.com/hook",
"socialUpdated": "2023-10-26T03:20:46Z",
"status": "success",
"updated": "2024-01-11T18:20:51Z"
}
{
"webhooks": [
{
"messages": "https://mywebsite.com/hook",
"messagesUpdated": "2024-12-11T09:58:22Z",
"refId": "d0b8bf39805ae442094137f09f2417bf2s82",
"scheduled": "https://mywebsite.com/hook",
"scheduledUpdated": "2024-02-19T12:17:12Z",
"status": "success",
"updated": "2023-08-22T11:55:06Z"
}
]
}
⌘I
