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."
}
delete エンドポイントを使うと、Ayrshare 経由で送信されたコメント、または Ayrshare 外部で送信されたコメントのどちらでも削除できます。
各種 ID の詳細は Comments Overview を参照してください。
たとえば、Get Comments エンドポイントで
返される JSON には各コメントの
Ayrshare から送信されたコメントの削除
Ayrshare 経由で送信された、単一のコメントまたは投稿配下のすべてのコメントを削除します。 詳細は Ayrshare Post ID と Ayrshare Comment ID を参照してください。 対応プラットフォーム: Bluesky、Facebook、Instagram、LinkedIn、Reddit、TikTok、X/Twitter、YouTube。Ayrshare 外部で送信されたコメントの削除
Ayrshare 経由で送信されていないコメントを、特定のソーシャルネットワークで返されるcommentId を使って削除します。
これはソーシャルネットワークからの Social Comment ID であり、Ayrshare の ID ではありません。
対応プラットフォーム: Facebook、Instagram、TikTok、X/Twitter、YouTube。
TikTok — 自作コメントのみ対応。 TikTok の
DELETE /comments は、認証済み TikTok アカウント自身が投稿したコメント(例:Ayrshare の reply エンドポイント または 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"
}
]
}
Header Parameters
Path Parameters
Ayrshare から送信されたコメントを削除する場合:
- Ayrshare Post ID を指定して、Ayrshare 経由で送信されたすべてのコメントを削除します。
- Ayrshare Comment ID を指定して、単一のコメントを削除します。
- ソーシャルネットワークの Social Comment ID を指定して、単一のコメントを削除します。
searchPlatformIdをtrueに設定してください。
Body Parameters
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"]
}
ソーシャルネットワークの
commentId に該当する Social Comment
ID を使って削除する場合は必須。対応プラットフォーム: bluesky, facebook, instagram, threads, tiktok, twitter, youtube。一度に指定できるプラットフォームは 1 つのみです。ソーシャルネットワークの
commentId に該当する Social Comment
ID を使って削除する場合、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" が返され、コメントがエコーバックされます。videoId なしで hide=true を送信すると 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
