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 concreta
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"
}
Obtén el historial de una publicación concreta. Sustituye
:id por el ID de publicación de Ayrshare devuelto por post.
Parámetros de cabecera
Parámetros de ruta
ID de publicación de Ayrshare devuelto por /post
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"
}
⌘I
