curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/history?startDate=2025-01-01T12:30:00Z&endDate=2025-03-01T12:30:00&limit=100
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/history?startDate=2025-01-01T12:30:00Z&endDate=2025-03-01T12:30:00&limit=100", {
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?startDate=2025-01-01T12:30:00Z&endDate=2025-03-01T12:30:00&limit=100', headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/history?startDate=2025-01-01T12:30:00Z&endDate=2025-03-01T12:30:00&limit=100';
$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 HistoryGETRequest_csharp
{
class History
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/history?startDate=2025-01-01T12:30:00Z&endDate=2025-03-01T12:30:00&limit=100";
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}");
}
}
}
}
}
{
"history": [
{
"errors": [],
"post": "This is the post I sent",
"platforms": [
"twitter",
"facebook"
],
"postIds": [
{
"status": "success",
"id": "1288968500063775749", // Twitter Social Post ID
"platform": "twitter"
},
{
"id": "104923907983682_108683297607743", // Facebook Social Post ID
"status": "success",
"platform": "facebook"
}
],
"urls": [],
"type": "now",
"notes": "Approved by John Smith", // Reference notes set via /post
"created": "2022-05-20T17:25:06Z",
"status": "deleted",
"scheduleDate": { // In a future release changed to "scheduleDate": "2020-11-05T12:21:29Z"
"_seconds": 1604578889,
"_nanoseconds": 211000000,
"utc": "2020-11-05T12:21:29Z"
},
"id": "rhn6u7wwz2WxGv6MZGK9" // Ayrshare Top-Level Post ID
},
{
"status": "success",
"platforms": [
"twitter",
"facebook"
],
"created": "2022-05-20T17:25:06Z",
"post": "Sometimes we need to take a break for lunch.",
"scheduleDate": { // In a future release changed to "scheduleDate": "2020-11-05T12:21:29Z"
"_seconds": 1604578889,
"_nanoseconds": 211000000,
"utc": "2020-11-05T12:21:29Z"
},
"type": "now",
"postIds": [
{
"platform": "twitter",
"id": "1288890036000983105", // Twitter Social Post ID
"status": "success"
},
{
"id": "104923907983682_108329970009742", // Facebook Social Post ID
"status": "success",
"platform": "facebook",
"isVideo": true // Video post
}
],
"errors": [],
"urls": [],
"id": "wWIY0OEirdNeYSJYm1Xa" // Ayrshare Post ID
},
{ // Awaiting approval post - Approved by user
"approved": true,
"approvedBy": "9abf1426d6ce9122ef11c7222e1",
"approvedDate": "2025-06-06T12:28:12Z",
"created": "2025-06-06T12:27:56Z",
"errors": [],
"id": "sujQsrXtroJU0NEOlY38",
"mediaUrls": [],
"platforms": [
"twitter"
],
"post": "I failed my way to success. - Thomas Edison",
"postIds": [
{
"status": "success",
"id": "193096515330813",
"postUrl": "https://twitter.com/RetiretyHQ/status/19309651533081",
"platform": "twitter"
}
],
"profileTitle": "Primary Profile",
"refId": "9abf1426d6ce9122ef11c7222e1",
"requiresApproval": true,
"scheduleDate": "2025-06-06T12:27:56Z",
"shortenLinks": false,
"status": "success",
"type": "now"
},
{ // Awaiting approval post - Rejected by user
"approved": false,
"created": "2025-06-06T12:23:48Z",
"id": "XL5xHeNK8HGTg07qxzmd",
"mediaUrls": [],
"platforms": [
"twitter"
],
"post": " Honesty is the first chapter in the book of wisdom. - Thomas Jefferson",
"profileTitle": "Primary Profile",
"refId": "9abf1426d6ce9122ef11c72bd62eddw2",
"rejectedBy": "9abf1426d6ce9122ef11c7222e1",
"rejectedDate": "2025-06-06T12:23:58Z",
"requiresApproval": true,
"scheduleDate": "2025-06-06T12:23:48Z",
"shortenLinks": false,
"status": "awaiting approval",
"type": "now"
}
],
"refId": "9abf1426d6ce9122ef11c72bd62e59807c5cc083",
"count": 100,
"lastUpdated": "2025-04-05T22:44:14.209Z",
"nextUpdate": "2025-04-05T22:45:14.209Z"
}
{
"action": "history",
"status": "error",
"code": 221,
"message": "History not found for the past 30 days. Please see the docs on how to retrieve additional history. .../ayrshare.com/rest-api/endpoints/history#list-history-of-sent-and-scheduled-posts"
}
History
سجل المنشورات
سجل منشورات Ayrshare
GET
/
history
curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/history?startDate=2025-01-01T12:30:00Z&endDate=2025-03-01T12:30:00&limit=100
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/history?startDate=2025-01-01T12:30:00Z&endDate=2025-03-01T12:30:00&limit=100", {
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?startDate=2025-01-01T12:30:00Z&endDate=2025-03-01T12:30:00&limit=100', headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/history?startDate=2025-01-01T12:30:00Z&endDate=2025-03-01T12:30:00&limit=100';
$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 HistoryGETRequest_csharp
{
class History
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/history?startDate=2025-01-01T12:30:00Z&endDate=2025-03-01T12:30:00&limit=100";
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}");
}
}
}
}
}
{
"history": [
{
"errors": [],
"post": "This is the post I sent",
"platforms": [
"twitter",
"facebook"
],
"postIds": [
{
"status": "success",
"id": "1288968500063775749", // Twitter Social Post ID
"platform": "twitter"
},
{
"id": "104923907983682_108683297607743", // Facebook Social Post ID
"status": "success",
"platform": "facebook"
}
],
"urls": [],
"type": "now",
"notes": "Approved by John Smith", // Reference notes set via /post
"created": "2022-05-20T17:25:06Z",
"status": "deleted",
"scheduleDate": { // In a future release changed to "scheduleDate": "2020-11-05T12:21:29Z"
"_seconds": 1604578889,
"_nanoseconds": 211000000,
"utc": "2020-11-05T12:21:29Z"
},
"id": "rhn6u7wwz2WxGv6MZGK9" // Ayrshare Top-Level Post ID
},
{
"status": "success",
"platforms": [
"twitter",
"facebook"
],
"created": "2022-05-20T17:25:06Z",
"post": "Sometimes we need to take a break for lunch.",
"scheduleDate": { // In a future release changed to "scheduleDate": "2020-11-05T12:21:29Z"
"_seconds": 1604578889,
"_nanoseconds": 211000000,
"utc": "2020-11-05T12:21:29Z"
},
"type": "now",
"postIds": [
{
"platform": "twitter",
"id": "1288890036000983105", // Twitter Social Post ID
"status": "success"
},
{
"id": "104923907983682_108329970009742", // Facebook Social Post ID
"status": "success",
"platform": "facebook",
"isVideo": true // Video post
}
],
"errors": [],
"urls": [],
"id": "wWIY0OEirdNeYSJYm1Xa" // Ayrshare Post ID
},
{ // Awaiting approval post - Approved by user
"approved": true,
"approvedBy": "9abf1426d6ce9122ef11c7222e1",
"approvedDate": "2025-06-06T12:28:12Z",
"created": "2025-06-06T12:27:56Z",
"errors": [],
"id": "sujQsrXtroJU0NEOlY38",
"mediaUrls": [],
"platforms": [
"twitter"
],
"post": "I failed my way to success. - Thomas Edison",
"postIds": [
{
"status": "success",
"id": "193096515330813",
"postUrl": "https://twitter.com/RetiretyHQ/status/19309651533081",
"platform": "twitter"
}
],
"profileTitle": "Primary Profile",
"refId": "9abf1426d6ce9122ef11c7222e1",
"requiresApproval": true,
"scheduleDate": "2025-06-06T12:27:56Z",
"shortenLinks": false,
"status": "success",
"type": "now"
},
{ // Awaiting approval post - Rejected by user
"approved": false,
"created": "2025-06-06T12:23:48Z",
"id": "XL5xHeNK8HGTg07qxzmd",
"mediaUrls": [],
"platforms": [
"twitter"
],
"post": " Honesty is the first chapter in the book of wisdom. - Thomas Jefferson",
"profileTitle": "Primary Profile",
"refId": "9abf1426d6ce9122ef11c72bd62eddw2",
"rejectedBy": "9abf1426d6ce9122ef11c7222e1",
"rejectedDate": "2025-06-06T12:23:58Z",
"requiresApproval": true,
"scheduleDate": "2025-06-06T12:23:48Z",
"shortenLinks": false,
"status": "awaiting approval",
"type": "now"
}
],
"refId": "9abf1426d6ce9122ef11c72bd62e59807c5cc083",
"count": 100,
"lastUpdated": "2025-04-05T22:44:14.209Z",
"nextUpdate": "2025-04-05T22:45:14.209Z"
}
{
"action": "history",
"status": "error",
"code": 221,
"message": "History not found for the past 30 days. Please see the docs on how to retrieve additional history. .../ayrshare.com/rest-api/endpoints/history#list-history-of-sent-and-scheduled-posts"
}
احصل على سجل بالمنشورات المُرسَلة عبر Ayrshare، بترتيب تنازلي (من الأحدث إلى الأقدم).
يمكنك عبر نقطة النهاية هذه استرجاع المنشورات من نطاق تاريخي محدد، أو حسب الحالة، أو الشبكة الاجتماعية، أو آخر n يومًا.
قيم حقول
status في السجل:
awaiting approval: منشورات في انتظار الموافقة عبر سير عمل الموافقة.deleted: تم حذف المنشور. ملاحظة: تُعاد المنشورات المحذوفة فقط عند استخدام مُصفّي الاستعلام status. راجع أدناه.error: حدث خطأ مع شبكة اجتماعية واحدة أو أكثر.paused: منشور مجدول تم إيقافه مؤقتًا.pending: لم تتم معالجة المنشور بعد. عادةً منشور مجدول.success: أُرسل المنشور بنجاح إلى جميع الشبكات الاجتماعية.
- يُعاد معرّف منشور Ayrshare في حقل
idبالاستجابة. - لاسترجاع منشورات نشأت خارج Ayrshare، مثل المنشورات المُنشأة يدويًا مباشرةً على الشبكة الاجتماعية، استخدم نقطة نهاية history platform.
- إذا كان مطلوبًا منشور فردي فقط، فاستخدم نقطة نهاية سجل المنشور حسب المعرّف.
- تُخزَّن نتائج JSON لنقطة نهاية السجل مؤقتًا لمدة دقيقة واحدة إذا كانت
limitأكبر من القيمة الافتراضية 25.
معاملات الترويسة
معاملات الاستعلام
يُعيد آخر n منشور. مثلًا، إذا أردت فقط أحدث منشور، اضبط
limit=1.
إن لم يُقدَّم، فسيُعيد جميع السجلات ضمن lastDays.الافتراضي: 25 منشورًا. القيمة القصوى: 1000.التصفية حسب منصات الشبكات الاجتماعية. قيم المنصات:
bluesky وfacebook وgmb وinstagram
وlinkedin وpinterest وreddit وsnapchat وtelegram وthreads وtiktok وtwitter
وyoutube. ملاحظة: تستخدم منطق OR: ["facebook", "instagram"] يُعيد منشورات من أيٍّ منهما.يُعيد المنشورات من تاريخ البداية هذا وشاملًا له. تاريخ البداية للسجل بتنسيق ISO 8601.
على سبيل المثال، استخدم التنسيق
YYYY-MM-DDThh:mm:ssZ وأرسل بصيغة 2026-07-08T12:30:00Z. راجع
utctime لمزيد من الأمثلة.يُعيد المنشورات حتى تاريخ النهاية هذا وشاملًا له. تاريخ النهاية للسجل بتنسيق ISO 8601. على سبيل
المثال، استخدم التنسيق
YYYY-MM-DDThh:mm:ssZ وأرسل بصيغة 2026-07-08T12:30:00Z. راجع
utctime لمزيد من الأمثلة.يُعيد منشورات آخر n يومًا بناءً على تاريخ النشر، أي
scheduleDate. الافتراضي 30 يومًا.- سيتم تجاهل
lastDaysإذا تم توفيرstartDateوendDate. - إذا كانت القيمة صفرًا 0 فسيُعيد سجل المنشورات بالكامل.
- إذا كانت القيمة أكبر من 0، فسيُعيد منشورات آخر n يومًا.
- مثلًا،
lastDays=5يُعيد منشورات آخر 5 أيام وlastDays=0يُعيد كل المنشورات وفقlimit.
التصفية حسب الحالة الحالية للمنشور. القيم الصالحة:
success وerror وprocessing وpending وpaused وdeleted وawaiting approval.
تشير processing إلى أن المنشور يجري إرساله حاليًا. تشير pending إلى أن المنشور مُجدوَل للنشر في تاريخ لاحق.لا تُعاد المنشورات المحذوفة افتراضيًا. تُعاد فقط عند تعيين مُصفّي الاستعلام status إلى
status=deleted.نوع المنشور المراد استرجاعه، إما منشورات أُرسلت فورًا أو منشورات مجدولة باستخدام حقل
scheduleDate. القيم: immediate أو scheduled.عند إنشاء إعادة نشر تلقائية، يُخصَّص معرّف لتتبع تلك السلسلة من المنشورات.
استرجع المنشورات حسب معرّف إعادة النشر التلقائية أو استخدم القيمة
all للحصول على جميع عمليات إعادة النشر التلقائية.curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/history?startDate=2025-01-01T12:30:00Z&endDate=2025-03-01T12:30:00&limit=100
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/history?startDate=2025-01-01T12:30:00Z&endDate=2025-03-01T12:30:00&limit=100", {
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?startDate=2025-01-01T12:30:00Z&endDate=2025-03-01T12:30:00&limit=100', headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/history?startDate=2025-01-01T12:30:00Z&endDate=2025-03-01T12:30:00&limit=100';
$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 HistoryGETRequest_csharp
{
class History
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/history?startDate=2025-01-01T12:30:00Z&endDate=2025-03-01T12:30:00&limit=100";
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}");
}
}
}
}
}
{
"history": [
{
"errors": [],
"post": "This is the post I sent",
"platforms": [
"twitter",
"facebook"
],
"postIds": [
{
"status": "success",
"id": "1288968500063775749", // Twitter Social Post ID
"platform": "twitter"
},
{
"id": "104923907983682_108683297607743", // Facebook Social Post ID
"status": "success",
"platform": "facebook"
}
],
"urls": [],
"type": "now",
"notes": "Approved by John Smith", // Reference notes set via /post
"created": "2022-05-20T17:25:06Z",
"status": "deleted",
"scheduleDate": { // In a future release changed to "scheduleDate": "2020-11-05T12:21:29Z"
"_seconds": 1604578889,
"_nanoseconds": 211000000,
"utc": "2020-11-05T12:21:29Z"
},
"id": "rhn6u7wwz2WxGv6MZGK9" // Ayrshare Top-Level Post ID
},
{
"status": "success",
"platforms": [
"twitter",
"facebook"
],
"created": "2022-05-20T17:25:06Z",
"post": "Sometimes we need to take a break for lunch.",
"scheduleDate": { // In a future release changed to "scheduleDate": "2020-11-05T12:21:29Z"
"_seconds": 1604578889,
"_nanoseconds": 211000000,
"utc": "2020-11-05T12:21:29Z"
},
"type": "now",
"postIds": [
{
"platform": "twitter",
"id": "1288890036000983105", // Twitter Social Post ID
"status": "success"
},
{
"id": "104923907983682_108329970009742", // Facebook Social Post ID
"status": "success",
"platform": "facebook",
"isVideo": true // Video post
}
],
"errors": [],
"urls": [],
"id": "wWIY0OEirdNeYSJYm1Xa" // Ayrshare Post ID
},
{ // Awaiting approval post - Approved by user
"approved": true,
"approvedBy": "9abf1426d6ce9122ef11c7222e1",
"approvedDate": "2025-06-06T12:28:12Z",
"created": "2025-06-06T12:27:56Z",
"errors": [],
"id": "sujQsrXtroJU0NEOlY38",
"mediaUrls": [],
"platforms": [
"twitter"
],
"post": "I failed my way to success. - Thomas Edison",
"postIds": [
{
"status": "success",
"id": "193096515330813",
"postUrl": "https://twitter.com/RetiretyHQ/status/19309651533081",
"platform": "twitter"
}
],
"profileTitle": "Primary Profile",
"refId": "9abf1426d6ce9122ef11c7222e1",
"requiresApproval": true,
"scheduleDate": "2025-06-06T12:27:56Z",
"shortenLinks": false,
"status": "success",
"type": "now"
},
{ // Awaiting approval post - Rejected by user
"approved": false,
"created": "2025-06-06T12:23:48Z",
"id": "XL5xHeNK8HGTg07qxzmd",
"mediaUrls": [],
"platforms": [
"twitter"
],
"post": " Honesty is the first chapter in the book of wisdom. - Thomas Jefferson",
"profileTitle": "Primary Profile",
"refId": "9abf1426d6ce9122ef11c72bd62eddw2",
"rejectedBy": "9abf1426d6ce9122ef11c7222e1",
"rejectedDate": "2025-06-06T12:23:58Z",
"requiresApproval": true,
"scheduleDate": "2025-06-06T12:23:48Z",
"shortenLinks": false,
"status": "awaiting approval",
"type": "now"
}
],
"refId": "9abf1426d6ce9122ef11c72bd62e59807c5cc083",
"count": 100,
"lastUpdated": "2025-04-05T22:44:14.209Z",
"nextUpdate": "2025-04-05T22:45:14.209Z"
}
{
"action": "history",
"status": "error",
"code": 221,
"message": "History not found for the past 30 days. Please see the docs on how to retrieve additional history. .../ayrshare.com/rest-api/endpoints/history#list-history-of-sent-and-scheduled-posts"
}
⌘I
