curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ", {
method: "DELETE",
headers: {
Authorization: `Bearer ${API_KEY}`,
},
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.delete('https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ', headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ'; // Replace with your post ID
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
];
$curl = curl_init($apiUrl);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => $headers
]);
$response = curl_exec($curl);
if ($response === false) {
echo 'Curl error: ' . curl_error($curl);
} else {
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
curl_close($curl);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace CommentsDELETERequest_csharp
{
class CommentsDELETE
{
private static readonly HttpClient client = new HttpClient();
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ";
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
try
{
HttpResponseMessage response = await client.DeleteAsync(url);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
{
"status": "success",
"bluesky": {
"action": "delete",
"status": "success",
"id": "at://did:plc:d/app.bsky.feed.post/3lez", // Bluesky Social Comment ID
"comment": "This is a comment"
},
"facebook": {
"action": "delete",
"status": "success",
"id": "938010233_939392023", // Facebook Social Comment ID
"comment": "This is a comment"
},
"instagram": {
"action": "delete",
"status": "success",
"id": "18010439663043269", // Instagram Social Comment ID
"comment": "This is a comment"
},
"linkedin": {
"action": "delete",
"status": "success",
"id": "7133271664032669696", // LinkedIn Social Comment ID
"comment": "This is a comment"
},
"threads": {
"action": "delete",
"status": "success",
"id": "18064102964006231" // Threads Social Comment ID
},
"tiktok": {
"action": "delete",
"status": "success",
"commentId": "7303719953248109358", // Deprecated December 1, 2023. Use the id field instead.
"id": "7303719953248109358", // TikTok Social Comment ID
"comment": "This is a comment"
},
"twitter": {
"action": "delete",
"status": "success",
"id": "1633128546494459904", // Twitter Social Comment ID
"comment": "This is a comment"
},
"youtube": {
"action": "delete",
"status": "success",
"id": "Ugy2m5u-LS9M29Gn3hd4AaABAg", // YouTub Social Comment ID
"comment": "This is a comment"
}
}
{
"status": "success",
"linkedin": [
{
"action": "delete",
"status": "success",
"id": "7090782997972410368", // LinkedIn Social Comment ID
"comment": "This is a comment"
},
{
"action": "delete",
"status": "success",
"id": "7090783025164103680", // LinkedIn Social Comment ID
"comment": "This is a comment"
}
],
"twitter": [
{
"action": "delete",
"posts": [
{
"action": "delete",
"status": "success",
"id": "1685017310942134272", // Twitter Social Comment ID
"comment": "This is a comment"
}
]
},
{
"action": "delete",
"posts": [
{
"action": "delete",
"status": "success",
"id": "1685017338184146946", // Twitter Social Comment ID
"comment": "This is a comment"
}
]
}
],
"facebook": [
{
"action": "delete",
"status": "success",
"id": "676770944469840_644047184361660", // Facebook Social Comment ID
"comment": "This is a comment"
},
{
"action": "delete",
"status": "success",
"id": "676770944469840_983782432932944", // Facebook Social Comment ID
"comment": "This is a comment"
}
]
}
{
"status": "success",
"tiktok": {
"action": "hide",
"status": "success",
"id": "7303719953248109358", // TikTok Social Comment ID
"comment": "This is a comment"
}
}
{
"action": "comments",
"status": "error",
"code": 219,
"message": "Error getting comments. Please verify the comments are still available."
}
Comments
刪除留言
刪除單一留言或某貼文底下的所有留言
DELETE
/
comments
/
:id
curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ", {
method: "DELETE",
headers: {
Authorization: `Bearer ${API_KEY}`,
},
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.delete('https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ', headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ'; // Replace with your post ID
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
];
$curl = curl_init($apiUrl);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => $headers
]);
$response = curl_exec($curl);
if ($response === false) {
echo 'Curl error: ' . curl_error($curl);
} else {
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
curl_close($curl);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace CommentsDELETERequest_csharp
{
class CommentsDELETE
{
private static readonly HttpClient client = new HttpClient();
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ";
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
try
{
HttpResponseMessage response = await client.DeleteAsync(url);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
{
"status": "success",
"bluesky": {
"action": "delete",
"status": "success",
"id": "at://did:plc:d/app.bsky.feed.post/3lez", // Bluesky Social Comment ID
"comment": "This is a comment"
},
"facebook": {
"action": "delete",
"status": "success",
"id": "938010233_939392023", // Facebook Social Comment ID
"comment": "This is a comment"
},
"instagram": {
"action": "delete",
"status": "success",
"id": "18010439663043269", // Instagram Social Comment ID
"comment": "This is a comment"
},
"linkedin": {
"action": "delete",
"status": "success",
"id": "7133271664032669696", // LinkedIn Social Comment ID
"comment": "This is a comment"
},
"threads": {
"action": "delete",
"status": "success",
"id": "18064102964006231" // Threads Social Comment ID
},
"tiktok": {
"action": "delete",
"status": "success",
"commentId": "7303719953248109358", // Deprecated December 1, 2023. Use the id field instead.
"id": "7303719953248109358", // TikTok Social Comment ID
"comment": "This is a comment"
},
"twitter": {
"action": "delete",
"status": "success",
"id": "1633128546494459904", // Twitter Social Comment ID
"comment": "This is a comment"
},
"youtube": {
"action": "delete",
"status": "success",
"id": "Ugy2m5u-LS9M29Gn3hd4AaABAg", // YouTub Social Comment ID
"comment": "This is a comment"
}
}
{
"status": "success",
"linkedin": [
{
"action": "delete",
"status": "success",
"id": "7090782997972410368", // LinkedIn Social Comment ID
"comment": "This is a comment"
},
{
"action": "delete",
"status": "success",
"id": "7090783025164103680", // LinkedIn Social Comment ID
"comment": "This is a comment"
}
],
"twitter": [
{
"action": "delete",
"posts": [
{
"action": "delete",
"status": "success",
"id": "1685017310942134272", // Twitter Social Comment ID
"comment": "This is a comment"
}
]
},
{
"action": "delete",
"posts": [
{
"action": "delete",
"status": "success",
"id": "1685017338184146946", // Twitter Social Comment ID
"comment": "This is a comment"
}
]
}
],
"facebook": [
{
"action": "delete",
"status": "success",
"id": "676770944469840_644047184361660", // Facebook Social Comment ID
"comment": "This is a comment"
},
{
"action": "delete",
"status": "success",
"id": "676770944469840_983782432932944", // Facebook Social Comment ID
"comment": "This is a comment"
}
]
}
{
"status": "success",
"tiktok": {
"action": "hide",
"status": "success",
"id": "7303719953248109358", // TikTok Social Comment ID
"comment": "This is a comment"
}
}
{
"action": "comments",
"status": "error",
"code": 219,
"message": "Error getting comments. Please verify the comments are still available."
}
刪除端點讓你可以刪除透過 Ayrshare 發送的留言,或是在 Ayrshare 之外發送的留言。
不同 ID 類型的詳情請參閱留言概觀。
例如,你可以透過 Get Comments 端點並將
回傳的 JSON 中每則留言都會有一個
刪除從 Ayrshare 發送的留言
刪除單一留言或某貼文底下透過 Ayrshare 發送的所有留言。 詳情請參閱 Ayrshare Post ID 與 Ayrshare Comment ID。 支援平台:Bluesky、Facebook、Instagram、LinkedIn、Reddit、TikTok、X/Twitter 與 YouTube。刪除非透過 Ayrshare 發送的留言
使用特定社群網路回傳的commentId 來刪除非透過 Ayrshare 發送的留言。
這是來自社群網路的 Social Comment ID,而非 Ayrshare ID。
支援平台:Facebook、Instagram、TikTok、X/Twitter 與 YouTube。
TikTok — 僅限自己撰寫的留言。 在 TikTok 上,
DELETE /comments 僅對已認證 TikTok 帳號本身所撰寫的留言成功(例如你透過 Ayrshare 的回覆端點所張貼的回覆,或直接在 TikTok App 中張貼的回覆)。嘗試刪除其他使用者所撰寫的留言 — 即使是留在你自己影片下的 — 會回傳 Ayrshare code: 328。若你需要審核自己 TikTok 影片下的第三方留言,請聯絡支援,讓我們確認你所連結的帳號類型上有哪些可用選項。searchPlatformId 設為 true,取得某則 Instagram 貼文的所有留言。
GET https://api.ayrshare.com/api/comments/18231730279304111?platform=instagram&searchPlatformId=true
commentId,可用於刪除該留言。記得將 searchPlatformId 設為 true。
{
"instagram": [
{
"comment": "What an amazing comment",
"commentId": "17969247335804735",
"created": "2024-11-26T11:49:00Z",
"from": {
"id": "103038435208332",
"username": "john_smith"
},
"hidden": false,
"likeCount": 3,
"platform": "instagram",
"postId": "18231730279304333",
"username": "john_smith"
}
]
}
標頭參數
路徑參數
刪除從 Ayrshare 發送的留言:
- 提供 Ayrshare Post ID,刪除該貼文透過 Ayrshare 發送的所有留言。
- 提供 Ayrshare Comment ID,刪除單一留言。
- 提供來自社群網路的 Social Comment ID,刪除單一留言。
- 必須將
searchPlatformId設為true。
主體參數
刪除透過 Ayrshare 發送的留言時為必填。要刪除留言的平台。支援平台:
bluesky、facebook、instagram、linkedin、reddit、threads、tiktok、twitter、youtube。Deleting comments sent via Ayrshare
DELETE /comments/:id // Ayrshare Post ID or Ayrshare Comment ID
{
"platforms": ["bluesky", "facebook", "instagram", "linkedin", "reddit", "threads", "tiktok", "twitter", "youtube"]
}
使用 Social Comment ID(即社群網路的
commentId)刪除時為必填。支援平台:bluesky、facebook、instagram、threads、tiktok、twitter、youtube。一次僅支援一個平台。使用 Social Comment ID(即社群網路的
commentId)刪除時為必填,並設為 true。Deleting comments with Social Comment ID
DELETE /comments/:id // Social Comment ID
{
"searchPlatformId": true,
// bluesky, facebook, instagram, threads, tiktok, twitter, youtube
"platform": "facebook"
}
僅限 TikTok。將此欄位與
videoId 一同設為 true,可將 TikTok 留言對公開觀眾隱藏,而非刪除。成功回應會回傳 action: "hide" 並回傳該留言內容。若傳入 hide=true 但未提供 videoId,會回傳 HTTP 400。被隱藏的留言在 TikTok Studio 中仍會對影片擁有者顯示。Hiding a TikTok comment
DELETE /comments/:id // Social Comment ID
{
"searchPlatformId": true,
"platform": "tiktok",
"hide": true,
"videoId": "7303719953248109358"
}
在隱藏 TikTok 留言(
hide=true)時為必填。該留言所屬的 TikTok 影片 ID。curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ", {
method: "DELETE",
headers: {
Authorization: `Bearer ${API_KEY}`,
},
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.delete('https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ', headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ'; // Replace with your post ID
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
];
$curl = curl_init($apiUrl);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => $headers
]);
$response = curl_exec($curl);
if ($response === false) {
echo 'Curl error: ' . curl_error($curl);
} else {
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
curl_close($curl);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace CommentsDELETERequest_csharp
{
class CommentsDELETE
{
private static readonly HttpClient client = new HttpClient();
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ";
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
try
{
HttpResponseMessage response = await client.DeleteAsync(url);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
{
"status": "success",
"bluesky": {
"action": "delete",
"status": "success",
"id": "at://did:plc:d/app.bsky.feed.post/3lez", // Bluesky Social Comment ID
"comment": "This is a comment"
},
"facebook": {
"action": "delete",
"status": "success",
"id": "938010233_939392023", // Facebook Social Comment ID
"comment": "This is a comment"
},
"instagram": {
"action": "delete",
"status": "success",
"id": "18010439663043269", // Instagram Social Comment ID
"comment": "This is a comment"
},
"linkedin": {
"action": "delete",
"status": "success",
"id": "7133271664032669696", // LinkedIn Social Comment ID
"comment": "This is a comment"
},
"threads": {
"action": "delete",
"status": "success",
"id": "18064102964006231" // Threads Social Comment ID
},
"tiktok": {
"action": "delete",
"status": "success",
"commentId": "7303719953248109358", // Deprecated December 1, 2023. Use the id field instead.
"id": "7303719953248109358", // TikTok Social Comment ID
"comment": "This is a comment"
},
"twitter": {
"action": "delete",
"status": "success",
"id": "1633128546494459904", // Twitter Social Comment ID
"comment": "This is a comment"
},
"youtube": {
"action": "delete",
"status": "success",
"id": "Ugy2m5u-LS9M29Gn3hd4AaABAg", // YouTub Social Comment ID
"comment": "This is a comment"
}
}
{
"status": "success",
"linkedin": [
{
"action": "delete",
"status": "success",
"id": "7090782997972410368", // LinkedIn Social Comment ID
"comment": "This is a comment"
},
{
"action": "delete",
"status": "success",
"id": "7090783025164103680", // LinkedIn Social Comment ID
"comment": "This is a comment"
}
],
"twitter": [
{
"action": "delete",
"posts": [
{
"action": "delete",
"status": "success",
"id": "1685017310942134272", // Twitter Social Comment ID
"comment": "This is a comment"
}
]
},
{
"action": "delete",
"posts": [
{
"action": "delete",
"status": "success",
"id": "1685017338184146946", // Twitter Social Comment ID
"comment": "This is a comment"
}
]
}
],
"facebook": [
{
"action": "delete",
"status": "success",
"id": "676770944469840_644047184361660", // Facebook Social Comment ID
"comment": "This is a comment"
},
{
"action": "delete",
"status": "success",
"id": "676770944469840_983782432932944", // Facebook Social Comment ID
"comment": "This is a comment"
}
]
}
{
"status": "success",
"tiktok": {
"action": "hide",
"status": "success",
"id": "7303719953248109358", // TikTok Social Comment ID
"comment": "This is a comment"
}
}
{
"action": "comments",
"status": "error",
"code": 219,
"message": "Error getting comments. Please verify the comments are still available."
}
⌘I
