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
PUT
/
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"
}
]
}
جدولة المنشورات بشكل مجمّع باستخدام ملف CSV (قيم مفصولة بفواصل) يحتوي على بيانات المنشورات.
يجب أن يكون Content-Type هو
multipart/form-data.
نوصي باستخدام نقطة نهاية Post المباشرة بدلاً من هذه الطريقة المجمّعة
لجدولة المنشورات. توفر نقطة النهاية المباشرة مجموعة ميزات أكثر شمولاً وإمكانيات
تصحيح أخطاء أسهل.
معلمات الترويسة
string
مطلوب
التنسيق:
Authorization: Bearer API_KEY. راجع نظرة عامة على واجهة برمجة التطبيقات لمزيد من
المعلومات.string
مفتاح ملف تعريف مستخدم.
string
مطلوب
Content-Type: multipart/form-dataمعلمات الجسم
أمثلة على الطلبات
سيقوم 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 لمزيد من الأمثلة.
لا ترسل منشورات مكررة بفارق أقل من يومين.إذا كان scheduleDate لمنشورين يحتويان على نفس النص تمامًا بفارق أقل من ثلاثة أيام، فسيتم رفض المنشور الثاني عند حلول scheduleDate.
هذا لحماية حسابك على الشبكات؛ يمكنهم تعليق الحسابات أو حظرها ضمنيًا (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"
}
]
}