curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"platforms": ["bluesky", "facebook", "instagram", "linkedin", "twitter", "youtube"], "comment": "An amazing reply!"}' \
-X POST https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${API_KEY}`,
},
body: JSON.stringify({
platforms: ["bluesky", "facebook", "instagram", "linkedin", "twitter", "youtube"], // required
comment: "An amazing comment!", //required
}),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'platforms': ['bluesky', 'facebook', 'instagram', 'linkedin', 'twitter', 'youtube'],
'comment': 'An amazing comment!'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.post('https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ',
json=payload,
headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ';
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
];
$data = json_encode([
'platforms' => ['bluesky', 'facebook', 'instagram', 'linkedin', 'twitter', 'youtube'],
'comment' => 'An amazing comment!'
]);
$curl = curl_init($apiUrl);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $data
]);
$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);
package main
import (
"bytes"
"encoding/json"
"log"
"net/http"
)
func main() {
message := map[string]interface{}{
"platforms": []string{"bluesky", "facebook", "instagram", "linkedin", "twitter", "youtube"}, // required
"comment": []string{"An amazing comment!"} // required
}
bytesRepresentation, err := json.Marshal(message)
if err != nil {
log.Fatalln(err)
}
req, _ := http.NewRequest("POST", "https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ",
bytes.NewBuffer(bytesRepresentation))
req.Header.Add("Content-Type", "application/json; charset=UTF-8")
req.Header.Add("Authorization", "Bearer API_KEY")
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal("Error:", err)
}
res.Body.Close()
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace CommentsReplyPOSTRequest_csharp
{
class CommentsReply
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ";
using (var httpClient = new HttpClient())
{
httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
var json = @"{
""platforms"": [""bluesky"", ""facebook"", ""instagram"", ""linkedin"", ""twitter"", ""youtube""],
""comment"": [""An amazing comment!""]
}";
var content = new StringContent(
json,
Encoding.UTF8,
"application/json"
);
try
{
var response = await httpClient.PostAsync(url, content);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
}
{
"commentId": "Eh61xHheGHvAqXqGISGVa",
"bluesky": {
"status": "success",
"commentId": "at://did:plc:62musrcyanhro2lydyhlw7ci/app.bsky.feed.post/3lf4bquqrxd2d",
"cid": "bafyreie2jt5iw6rk2ekmiq6aljyiv7nj4sjucbpkamqc73tmggh5fmrqha",
"comment": "Truth is ever to be found in simplicity.",
"platform": "bluesky",
"postUrl": "https://bsky.app/profile/ayrshare.com/post/3lf4bquqrxd2d",
"sourceCommentId": "at://did:plc:62musrcyanhro2lydyhlw7ci/app.bsky.feed.post/3lf4b4j3dqy2i"
},
"facebook": {
"status": "success",
"commentId": "729149842469573_696560159169326",
"sourceCommentId": "729149842469573_738966840899770",
"comment": "Truth is ever to be found in simplicity.",
"platform": "facebook"
},
"instagram": {
"status": "success",
"commentId": "18020060386920755",
"sourceCommentId": "17998452434360734",
"comment": "Truth is ever to be found in simplicity.",
"platform": "instagram"
},
"linkedin": {
"status": "success",
"commentId": "7140161360574713856",
"sourceCommentId": "urn:li:ugcPost:7140160850354397187",
"comment": "Truth is ever to be found in simplicity.",
"platform": "linkedin"
},
"tiktok": {
"status": "success",
"commentId": "7484295933044572922",
"sourceCommentId": "7484407021429703422",
"comment": "Truth is ever to be found in simplicity.",
"platform": "tiktok",
"videoId": "7484993689815715122"
},
"twitter": {
"status": "success",
"commentId": "1734395672961441821",
"sourceCommentId": "1734395509526155733",
"comment": "Truth is ever to be found in simplicity.",
"platform": "twitter",
"postUrl": "https://twitter.com/ayrshare/status/1734395672961441821"
},
"youtube": {
"status": "success",
"commentId": "UgxZ55j-FDri8lrTgVR4AaABAg.9yCaV71m1fo9yCaZvu7Hj4",
"sourceCommentId": "UgxZ55j-FDri8lrTgVR4AaABAg",
"comment": "Truth is ever to be found in simplicity.",
"platform": "youtube"
},
"status": "success",
"id": "ytDgi5vyz36F2yshlJka"
}
{
"facebook": {
"action": "post",
"status": "error",
"code": 215,
"message": "Error posting comment. Please be sure you are posting a valid comment, the original post exists, the original post is publicly available."
},
"code": 215,
"status": "error",
"errors": [
{
"action": "post",
"status": "error",
"code": 215,
"message": "Error posting comment. Please be sure you are posting a valid comment, the original post exists, the original post is publicly available.",
"platform": "facebook"
}
],
"id": "5360106757501_178916202161"
}
Comments
Відповідь на коментар
Прокоментувати коментар
POST
/
comments
/
reply
/
:commentId
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"platforms": ["bluesky", "facebook", "instagram", "linkedin", "twitter", "youtube"], "comment": "An amazing reply!"}' \
-X POST https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${API_KEY}`,
},
body: JSON.stringify({
platforms: ["bluesky", "facebook", "instagram", "linkedin", "twitter", "youtube"], // required
comment: "An amazing comment!", //required
}),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'platforms': ['bluesky', 'facebook', 'instagram', 'linkedin', 'twitter', 'youtube'],
'comment': 'An amazing comment!'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.post('https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ',
json=payload,
headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ';
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
];
$data = json_encode([
'platforms' => ['bluesky', 'facebook', 'instagram', 'linkedin', 'twitter', 'youtube'],
'comment' => 'An amazing comment!'
]);
$curl = curl_init($apiUrl);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $data
]);
$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);
package main
import (
"bytes"
"encoding/json"
"log"
"net/http"
)
func main() {
message := map[string]interface{}{
"platforms": []string{"bluesky", "facebook", "instagram", "linkedin", "twitter", "youtube"}, // required
"comment": []string{"An amazing comment!"} // required
}
bytesRepresentation, err := json.Marshal(message)
if err != nil {
log.Fatalln(err)
}
req, _ := http.NewRequest("POST", "https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ",
bytes.NewBuffer(bytesRepresentation))
req.Header.Add("Content-Type", "application/json; charset=UTF-8")
req.Header.Add("Authorization", "Bearer API_KEY")
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal("Error:", err)
}
res.Body.Close()
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace CommentsReplyPOSTRequest_csharp
{
class CommentsReply
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ";
using (var httpClient = new HttpClient())
{
httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
var json = @"{
""platforms"": [""bluesky"", ""facebook"", ""instagram"", ""linkedin"", ""twitter"", ""youtube""],
""comment"": [""An amazing comment!""]
}";
var content = new StringContent(
json,
Encoding.UTF8,
"application/json"
);
try
{
var response = await httpClient.PostAsync(url, content);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
}
{
"commentId": "Eh61xHheGHvAqXqGISGVa",
"bluesky": {
"status": "success",
"commentId": "at://did:plc:62musrcyanhro2lydyhlw7ci/app.bsky.feed.post/3lf4bquqrxd2d",
"cid": "bafyreie2jt5iw6rk2ekmiq6aljyiv7nj4sjucbpkamqc73tmggh5fmrqha",
"comment": "Truth is ever to be found in simplicity.",
"platform": "bluesky",
"postUrl": "https://bsky.app/profile/ayrshare.com/post/3lf4bquqrxd2d",
"sourceCommentId": "at://did:plc:62musrcyanhro2lydyhlw7ci/app.bsky.feed.post/3lf4b4j3dqy2i"
},
"facebook": {
"status": "success",
"commentId": "729149842469573_696560159169326",
"sourceCommentId": "729149842469573_738966840899770",
"comment": "Truth is ever to be found in simplicity.",
"platform": "facebook"
},
"instagram": {
"status": "success",
"commentId": "18020060386920755",
"sourceCommentId": "17998452434360734",
"comment": "Truth is ever to be found in simplicity.",
"platform": "instagram"
},
"linkedin": {
"status": "success",
"commentId": "7140161360574713856",
"sourceCommentId": "urn:li:ugcPost:7140160850354397187",
"comment": "Truth is ever to be found in simplicity.",
"platform": "linkedin"
},
"tiktok": {
"status": "success",
"commentId": "7484295933044572922",
"sourceCommentId": "7484407021429703422",
"comment": "Truth is ever to be found in simplicity.",
"platform": "tiktok",
"videoId": "7484993689815715122"
},
"twitter": {
"status": "success",
"commentId": "1734395672961441821",
"sourceCommentId": "1734395509526155733",
"comment": "Truth is ever to be found in simplicity.",
"platform": "twitter",
"postUrl": "https://twitter.com/ayrshare/status/1734395672961441821"
},
"youtube": {
"status": "success",
"commentId": "UgxZ55j-FDri8lrTgVR4AaABAg.9yCaV71m1fo9yCaZvu7Hj4",
"sourceCommentId": "UgxZ55j-FDri8lrTgVR4AaABAg",
"comment": "Truth is ever to be found in simplicity.",
"platform": "youtube"
},
"status": "success",
"id": "ytDgi5vyz36F2yshlJka"
}
{
"facebook": {
"action": "post",
"status": "error",
"code": 215,
"message": "Error posting comment. Please be sure you are posting a valid comment, the original post exists, the original post is publicly available."
},
"code": 215,
"status": "error",
"errors": [
{
"action": "post",
"status": "error",
"code": 215,
"message": "Error posting comment. Please be sure you are posting a valid comment, the original post exists, the original post is publicly available.",
"platform": "facebook"
}
],
"id": "5360106757501_178916202161"
}
Відповідайте на коментар, тобто коментуйте коментар — як на коментар, зроблений через Ayrshare, використовуючи Ayrshare Comment ID, так і на коментар, зроблений поза Ayrshare, використовуючи Social Comment ID.
Найчастіше ви відповідатимете на коментар, зроблений через Ayrshare, але коли ви хочете відповісти на коментар, зроблений поза Ayrshare, ви можете використати Social Comment ID, який отримуєте з ендпоінту GET /comment.
Підтримувані платформи: Bluesky, Facebook, Instagram, LinkedIn, TikTok, X та YouTube.
Для докладного синтаксису згадок та обмежень для кожної платформи див.:
Параметри заголовка
Параметри шляху
Якщо відповідаєте на коментар, зроблений через Ayrshare, використайте Ayrshare Comment ID Якщо відповідаєте на коментар, зроблений поза Ayrshare, використайте Social Comment ID
commentId, повернутий з ендпоінту POST comment.Наприклад, Ayrshare Comment ID commentId, повернутий з ендпоінту POST comment:Ayrshare Comment ID Returned from POST /comment
{
"commentId": "Ut1fWU6XkqkMayHGnJZ"
}
commentId із соціальної мережі.Наприклад, Social Comment ID commentId, повернутий з ендпоінту Facebook POST /comment або GET /comment:Social Comment ID Returned from POST /comment
{
"facebook": { "commentId": "8392829334_1234567890" }
}
Параметри тіла
Якщо відповідаєте на коментар, зроблений через Ayrshare, використовуючи Ayrshare Comment ID, вкажіть платформи для публікації відповіді. Підтримувані платформи:
bluesky, facebook, instagram, linkedin, tiktok, twitter, youtube.Якщо відповідаєте на коментар, зроблений поза Ayrshare, використовуючи Social Comment ID, вкажіть одну платформу для публікації відповіді. Підтримувані платформи: facebook, instagram, linkedin, tiktok, twitter.Відповідь, яку додати до коментаря.
Прикріпіть зображення, вказавши URL зображення. Підтримується лише одне зображення. Лише для Facebook та LinkedIn.
Встановіть у
true, якщо відповідаєте на коментар за допомогою Social Comment ID, тобто commentId публікації із соціальних мереж.Якщо відповідаєте на коментар TikTok із Social Comment ID, ви також повинні надати ID відео TikTok, який ви отримуєте з ендпоінту POST /comment або ендпоінту GET /comment.
Обов’язково лише для TikTok та
"searchPlatformId": true.Відповідь як об’єкт, інакше як масив. За замовчуванням
true.@Згадки в коментарях
Ви можете додавати @згадки безпосередньо в текстовий рядокcomment. Окремого параметра для згадок немає. Просто додайте @handle у текст коментаря.
Reply with @Mention
{
"comment": "Thanks @CompanyName! Great insight.",
"platforms": ["linkedin", "twitter", "facebook"]
}
Згадки в LinkedIn: Згадки в LinkedIn розв’язуються Ayrshare на стороні сервера. Використовуйте ендпоінт LinkedIn Search для пошуку правильного vanity name або member name. Для організацій використовуйте
@handle. Для учасників — @vanity_name або @[Full Name].- Bluesky mentions
- Facebook mentions
- Instagram mentions
- LinkedIn mentions
- Threads mentions
- TikTok mentions
- X/Twitter mentions
- YouTube mentions
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"platforms": ["bluesky", "facebook", "instagram", "linkedin", "twitter", "youtube"], "comment": "An amazing reply!"}' \
-X POST https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${API_KEY}`,
},
body: JSON.stringify({
platforms: ["bluesky", "facebook", "instagram", "linkedin", "twitter", "youtube"], // required
comment: "An amazing comment!", //required
}),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'platforms': ['bluesky', 'facebook', 'instagram', 'linkedin', 'twitter', 'youtube'],
'comment': 'An amazing comment!'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.post('https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ',
json=payload,
headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ';
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
];
$data = json_encode([
'platforms' => ['bluesky', 'facebook', 'instagram', 'linkedin', 'twitter', 'youtube'],
'comment' => 'An amazing comment!'
]);
$curl = curl_init($apiUrl);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $data
]);
$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);
package main
import (
"bytes"
"encoding/json"
"log"
"net/http"
)
func main() {
message := map[string]interface{}{
"platforms": []string{"bluesky", "facebook", "instagram", "linkedin", "twitter", "youtube"}, // required
"comment": []string{"An amazing comment!"} // required
}
bytesRepresentation, err := json.Marshal(message)
if err != nil {
log.Fatalln(err)
}
req, _ := http.NewRequest("POST", "https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ",
bytes.NewBuffer(bytesRepresentation))
req.Header.Add("Content-Type", "application/json; charset=UTF-8")
req.Header.Add("Authorization", "Bearer API_KEY")
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal("Error:", err)
}
res.Body.Close()
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace CommentsReplyPOSTRequest_csharp
{
class CommentsReply
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/comments/reply/Ut1fWU6XkqkMayHGnJZ";
using (var httpClient = new HttpClient())
{
httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
var json = @"{
""platforms"": [""bluesky"", ""facebook"", ""instagram"", ""linkedin"", ""twitter"", ""youtube""],
""comment"": [""An amazing comment!""]
}";
var content = new StringContent(
json,
Encoding.UTF8,
"application/json"
);
try
{
var response = await httpClient.PostAsync(url, content);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
}
{
"commentId": "Eh61xHheGHvAqXqGISGVa",
"bluesky": {
"status": "success",
"commentId": "at://did:plc:62musrcyanhro2lydyhlw7ci/app.bsky.feed.post/3lf4bquqrxd2d",
"cid": "bafyreie2jt5iw6rk2ekmiq6aljyiv7nj4sjucbpkamqc73tmggh5fmrqha",
"comment": "Truth is ever to be found in simplicity.",
"platform": "bluesky",
"postUrl": "https://bsky.app/profile/ayrshare.com/post/3lf4bquqrxd2d",
"sourceCommentId": "at://did:plc:62musrcyanhro2lydyhlw7ci/app.bsky.feed.post/3lf4b4j3dqy2i"
},
"facebook": {
"status": "success",
"commentId": "729149842469573_696560159169326",
"sourceCommentId": "729149842469573_738966840899770",
"comment": "Truth is ever to be found in simplicity.",
"platform": "facebook"
},
"instagram": {
"status": "success",
"commentId": "18020060386920755",
"sourceCommentId": "17998452434360734",
"comment": "Truth is ever to be found in simplicity.",
"platform": "instagram"
},
"linkedin": {
"status": "success",
"commentId": "7140161360574713856",
"sourceCommentId": "urn:li:ugcPost:7140160850354397187",
"comment": "Truth is ever to be found in simplicity.",
"platform": "linkedin"
},
"tiktok": {
"status": "success",
"commentId": "7484295933044572922",
"sourceCommentId": "7484407021429703422",
"comment": "Truth is ever to be found in simplicity.",
"platform": "tiktok",
"videoId": "7484993689815715122"
},
"twitter": {
"status": "success",
"commentId": "1734395672961441821",
"sourceCommentId": "1734395509526155733",
"comment": "Truth is ever to be found in simplicity.",
"platform": "twitter",
"postUrl": "https://twitter.com/ayrshare/status/1734395672961441821"
},
"youtube": {
"status": "success",
"commentId": "UgxZ55j-FDri8lrTgVR4AaABAg.9yCaV71m1fo9yCaZvu7Hj4",
"sourceCommentId": "UgxZ55j-FDri8lrTgVR4AaABAg",
"comment": "Truth is ever to be found in simplicity.",
"platform": "youtube"
},
"status": "success",
"id": "ytDgi5vyz36F2yshlJka"
}
{
"facebook": {
"action": "post",
"status": "error",
"code": 215,
"message": "Error posting comment. Please be sure you are posting a valid comment, the original post exists, the original post is publicly available."
},
"code": 215,
"status": "error",
"errors": [
{
"action": "post",
"status": "error",
"code": 215,
"message": "Error posting comment. Please be sure you are posting a valid comment, the original post exists, the original post is publicly available.",
"platform": "facebook"
}
],
"id": "5360106757501_178916202161"
}
⌘I
