curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: multipart/form-data' \
-F 'file=@"./Ayrshare CSV Template.csv"' \
-X POST https://api.ayrshare.com/api/post/bulk
const API_KEY = "API_KEY";
const FormData = require("form-data");
const fs = require("fs");
const formData = new FormData();
formData.append("file", fs.createReadStream("./Ayrshare CSV Template.csv"));
fetch("https://api.ayrshare.com/api/post/bulk", {
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
...formData.getHeaders()
},
body: formData
})
.then((res) => res.json())
.then((data) => {
console.log(JSON.stringify(data));
})
.catch((error) => {
console.log(error);
});
import requests
API_KEY = "API_KEY"
# Open the CSV file in binary read mode
with open('./Ayrshare CSV Template.csv', 'rb') as file:
# Prepare the files dictionary for the multipart/form-data request
files = {'file': file}
# Set up the authorization header
headers = {'Authorization': f'Bearer {API_KEY}'}
try:
# Make the POST request to the API
response = requests.post(
'https://api.ayrshare.com/api/post/bulk',
headers=headers,
files=files
)
# Parse and print the JSON response
data = response.json()
print(data)
except Exception as e:
print(f"Error: {e}")
{
"status": "success",
"posts": [
{
"status": "scheduled",
"scheduleDate": "4/6/21 12:50",
"id": "X3uTExuEJhyM3u8wCRsA",
"post": "A great post"
},
{
"status": "scheduled",
"scheduleDate": "4/6/21 13:00",
"id": "8RGrekuxMnVa7lVnARFm",
"post": "An even better post"
}
]
}
Post
النشر المجمّع
جدولة منشورات متعددة دفعة واحدة برفع ملف CSV بصيغة multipart/form-data، مع الحقول المطلوبة في الملف وقواعد المنشورات المكررة وقالب CSV.
POST
/
post
/
bulk
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: multipart/form-data' \
-F 'file=@"./Ayrshare CSV Template.csv"' \
-X POST https://api.ayrshare.com/api/post/bulk
const API_KEY = "API_KEY";
const FormData = require("form-data");
const fs = require("fs");
const formData = new FormData();
formData.append("file", fs.createReadStream("./Ayrshare CSV Template.csv"));
fetch("https://api.ayrshare.com/api/post/bulk", {
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
...formData.getHeaders()
},
body: formData
})
.then((res) => res.json())
.then((data) => {
console.log(JSON.stringify(data));
})
.catch((error) => {
console.log(error);
});
import requests
API_KEY = "API_KEY"
# Open the CSV file in binary read mode
with open('./Ayrshare CSV Template.csv', 'rb') as file:
# Prepare the files dictionary for the multipart/form-data request
files = {'file': file}
# Set up the authorization header
headers = {'Authorization': f'Bearer {API_KEY}'}
try:
# Make the POST request to the API
response = requests.post(
'https://api.ayrshare.com/api/post/bulk',
headers=headers,
files=files
)
# Parse and print the JSON response
data = response.json()
print(data)
except Exception as e:
print(f"Error: {e}")
{
"status": "success",
"posts": [
{
"status": "scheduled",
"scheduleDate": "4/6/21 12:50",
"id": "X3uTExuEJhyM3u8wCRsA",
"post": "A great post"
},
{
"status": "scheduled",
"scheduleDate": "4/6/21 13:00",
"id": "8RGrekuxMnVa7lVnARFm",
"post": "An even better post"
}
]
}
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.
multipart/form-data.
نوصي باستخدام نقطة نهاية Post المباشرة بدلاً من هذه الطريقة المجمّعة
لجدولة المنشورات. توفر نقطة النهاية المباشرة مجموعة ميزات أكثر شمولاً وإمكانيات
تصحيح أخطاء أسهل.
معلمات الترويسة
التنسيق:
Authorization: Bearer API_KEY. راجع نظرة عامة على واجهة برمجة التطبيقات لمزيد من
المعلومات.معلمات الجسم
ملف CSV multipart form-data للمنشورات المجدولة. راجع أدناه قالب CSV.
أمثلة على الطلبات
سيقوم multipart form-data يحتوي على ملف CSV من المنشورات بجدولتها لتاريخ مستقبلي. يحتوي ملف CSV على الحقول التالية (القالب أدناه) وهي مطلوبة:post: نص المنشور.platforms: قائمة منصات مفصولة بفواصل، مثل “twitter, facebook, instagram”.mediaUrls: عنوان URL للوسائط، مثل صورة أو فيديو لتضمينها في المنشور.scheduleDate: التاريخ والوقت لجدولة المنشور بتنسيق UTC. على سبيل المثال، استخدم التنسيقYYYY-MM-DDThh:mm:ssZوأرسله كـ2026-07-08T12:30:00Z. يرجى الاطلاع على utctime لمزيد من الأمثلة.
لا تُجدول منشورات مكررة خلال 24 ساعة من بعضها.يُفحص كل منشور ضمن نافذة مدتها 48 ساعة تتمحور حول
scheduleDate الخاص به — 24 ساعة قبله و24 ساعة بعده. إذا وُجد داخل هذه النافذة منشور آخر بنص مطابق أو شبه مطابق، فسيُرفض المنشور بالخطأ 137. ولأن النافذة تمتد إلى الأمام كما تمتد إلى الخلف، يمكن رفض صف بسبب صف مجدول بعده. ويجري هذا الفحص عند إرسال المنشور أو جدولته، وليس فقط عند اقتراب موعد نشره.
هذا لحماية حسابك على الشبكات؛ يمكنهم تعليق الحسابات أو حظرها ضمنيًا (shadow-ban) بسبب المنشورات المكررة المتكررة.قالب CSV
قم بتنزيل القالب وحفظه كملف .csv. قالب CSV من Ayrsharecurl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: multipart/form-data' \
-F 'file=@"./Ayrshare CSV Template.csv"' \
-X POST https://api.ayrshare.com/api/post/bulk
const API_KEY = "API_KEY";
const FormData = require("form-data");
const fs = require("fs");
const formData = new FormData();
formData.append("file", fs.createReadStream("./Ayrshare CSV Template.csv"));
fetch("https://api.ayrshare.com/api/post/bulk", {
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
...formData.getHeaders()
},
body: formData
})
.then((res) => res.json())
.then((data) => {
console.log(JSON.stringify(data));
})
.catch((error) => {
console.log(error);
});
import requests
API_KEY = "API_KEY"
# Open the CSV file in binary read mode
with open('./Ayrshare CSV Template.csv', 'rb') as file:
# Prepare the files dictionary for the multipart/form-data request
files = {'file': file}
# Set up the authorization header
headers = {'Authorization': f'Bearer {API_KEY}'}
try:
# Make the POST request to the API
response = requests.post(
'https://api.ayrshare.com/api/post/bulk',
headers=headers,
files=files
)
# Parse and print the JSON response
data = response.json()
print(data)
except Exception as e:
print(f"Error: {e}")
{
"status": "success",
"posts": [
{
"status": "scheduled",
"scheduleDate": "4/6/21 12:50",
"id": "X3uTExuEJhyM3u8wCRsA",
"post": "A great post"
},
{
"status": "scheduled",
"scheduleDate": "4/6/21 13:00",
"id": "8RGrekuxMnVa7lVnARFm",
"post": "An even better post"
}
]
}