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 类型的更多信息,请参见评论概述。
例如,你可以使用获取评论端点(将
返回的 JSON 中每条评论都会包含一个
删除通过 Ayrshare 发送的评论
删除通过 Ayrshare 发送的单条评论,或删除某条帖子下的所有评论。 更多信息请参见 Ayrshare 帖子 ID 和 Ayrshare 评论 ID。 支持的平台:Bluesky、Facebook、Instagram、LinkedIn、Reddit、TikTok、X/Twitter 和 YouTube。删除在 Ayrshare 外部发送的评论
通过使用特定社交网络返回的commentId 来删除并非通过 Ayrshare 发送的评论。
这是社交网络的社交评论 ID,而不是 Ayrshare 的 ID。
支持的平台:Facebook、Instagram、TikTok、X/Twitter 和 YouTube。
TikTok — 仅限自己发表的评论。 在 TikTok 上,
DELETE /comments 仅在评论由已认证的 TikTok 账户自身撰写时才会成功(例如你通过 Ayrshare 的回复端点或直接在 TikTok 应用中发布的回复)。尝试删除其他用户撰写的评论——即使是留在你自己视频下的评论——都会返回 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 帖子 ID 可删除通过 Ayrshare 发送的所有评论。
- 提供 Ayrshare 评论 ID 可删除单条评论。
- 提供社交网络的社交评论 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"]
}
当使用社交评论 ID(即社交网络返回的
commentId)进行删除时必填。支持的平台:bluesky、facebook、instagram、threads、tiktok、twitter、youtube。一次仅支持一个平台。当使用社交评论 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
