curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl", {
method: "GET",
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.get('https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl', headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl'; // 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_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 HistoryGETByIDRequest_csharp
{
class HistoryGetById
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
try
{
var response = await client.GetStringAsync(url);
Console.WriteLine(response);
}
catch (HttpRequestException ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
}
}
{
"tier": "business",
"status": "success",
"mediaUrls": [
"https://images.ayrshare.com/imgs/GhostBusters.jpg"
],
"postIds": [
{
"platform": "facebook",
"postUrl": "https://www.facebook.com/1105775157895689_361710168628052",
"status": "success",
"id": "105775157895689_361710168628052" // Facebook Social Post ID
}
],
"id": "TBEEAqAMMJoweA8wKHUp", // Ayrshare Post ID
"errors": [],
"platforms": [
"facebook"
],
"scheduleDate": { // In a future release changed to "scheduleDate": "2020-11-05T12:21:29Z"
"_seconds": 1604578889,
"_nanoseconds": 211000000,
"utc": "2020-11-05T12:21:29Z"
},
"createDate": { // deprecated, use created
"_seconds": 1653067506,
"_nanoseconds": 179000000,
"utc": "2022-05-20T17:25:06Z"
},
"created": "2022-05-20T17:25:06Z",
"shortenLinks": true,
"post": "Today is a great day",
"notes": "Approved by John Smith", // reference notes set via /post
"type": "scheduled"
}
{
"action": "history",
"status": "error",
"code": 221,
"message": "History not found.",
"id": "4W3f3RPr6QSrw8S5Yo8"
}
History
Historial de publicación por ID
Obtén el historial de una publicación con su ID de publicación de Ayrshare y el parámetro opcional searchAllPosts para buscar en todos los User Profiles.
GET
/
history
/
:id
curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl", {
method: "GET",
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.get('https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl', headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl'; // 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_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 HistoryGETByIDRequest_csharp
{
class HistoryGetById
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
try
{
var response = await client.GetStringAsync(url);
Console.WriteLine(response);
}
catch (HttpRequestException ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
}
}
{
"tier": "business",
"status": "success",
"mediaUrls": [
"https://images.ayrshare.com/imgs/GhostBusters.jpg"
],
"postIds": [
{
"platform": "facebook",
"postUrl": "https://www.facebook.com/1105775157895689_361710168628052",
"status": "success",
"id": "105775157895689_361710168628052" // Facebook Social Post ID
}
],
"id": "TBEEAqAMMJoweA8wKHUp", // Ayrshare Post ID
"errors": [],
"platforms": [
"facebook"
],
"scheduleDate": { // In a future release changed to "scheduleDate": "2020-11-05T12:21:29Z"
"_seconds": 1604578889,
"_nanoseconds": 211000000,
"utc": "2020-11-05T12:21:29Z"
},
"createDate": { // deprecated, use created
"_seconds": 1653067506,
"_nanoseconds": 179000000,
"utc": "2022-05-20T17:25:06Z"
},
"created": "2022-05-20T17:25:06Z",
"shortenLinks": true,
"post": "Today is a great day",
"notes": "Approved by John Smith", // reference notes set via /post
"type": "scheduled"
}
{
"action": "history",
"status": "error",
"code": 221,
"message": "History not found.",
"id": "4W3f3RPr6QSrw8S5Yo8"
}
Targeting X/Twitter? Starting March 31, 2026, all X operations require your own API credentials. After linking X via OAuth, include these 2 headers in your request:
One-time setup per Ayrshare account. You create one X Developer App and reuse the same API Key and Secret across every sub-profile / end-user you link. You do not create a new app per customer.
Not linked yet? See the full setup guide to connect your X account.
Your keys are never logged or stored by Ayrshare.
X-Twitter-OAuth1-Api-Key — Your API Key (Consumer Key)X-Twitter-OAuth1-Api-Secret — Your API Key Secret (Consumer Secret)One-time setup per Ayrshare account. You create one X Developer App and reuse the same API Key and Secret across every sub-profile / end-user you link. You do not create a new app per customer.
Not linked yet? See the full setup guide to connect your X account.
Your keys are never logged or stored by Ayrshare.
:id por el ID de publicación de Ayrshare devuelto por post.
Parámetros de cabecera
Parámetros de ruta
Parámetros de consulta
Busca el ID de la publicación en todas las publicaciones de todos los User Profiles. Valor por defecto:
falsecurl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl", {
method: "GET",
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.get('https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl', headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl'; // 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_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 HistoryGETByIDRequest_csharp
{
class HistoryGetById
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
try
{
var response = await client.GetStringAsync(url);
Console.WriteLine(response);
}
catch (HttpRequestException ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
}
}
{
"tier": "business",
"status": "success",
"mediaUrls": [
"https://images.ayrshare.com/imgs/GhostBusters.jpg"
],
"postIds": [
{
"platform": "facebook",
"postUrl": "https://www.facebook.com/1105775157895689_361710168628052",
"status": "success",
"id": "105775157895689_361710168628052" // Facebook Social Post ID
}
],
"id": "TBEEAqAMMJoweA8wKHUp", // Ayrshare Post ID
"errors": [],
"platforms": [
"facebook"
],
"scheduleDate": { // In a future release changed to "scheduleDate": "2020-11-05T12:21:29Z"
"_seconds": 1604578889,
"_nanoseconds": 211000000,
"utc": "2020-11-05T12:21:29Z"
},
"createDate": { // deprecated, use created
"_seconds": 1653067506,
"_nanoseconds": 179000000,
"utc": "2022-05-20T17:25:06Z"
},
"created": "2022-05-20T17:25:06Z",
"shortenLinks": true,
"post": "Today is a great day",
"notes": "Approved by John Smith", // reference notes set via /post
"type": "scheduled"
}
{
"action": "history",
"status": "error",
"code": 221,
"message": "History not found.",
"id": "4W3f3RPr6QSrw8S5Yo8"
}