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
Bulk-Post
Beiträge per CSV-Datei im Bulk planen
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"
}
]
}
Planen Sie Beiträge im Bulk mit einer CSV-Datei (Comma Separated Values), die Beitragsdaten enthält.
Der Content-Type muss
multipart/form-data sein.
Wir empfehlen, stattdessen den direkten Post-Endpunkt zum Planen von Beiträgen zu verwenden.
Der direkte Endpunkt bietet einen umfassenderen Funktionsumfang und einfachere
Debugging-Möglichkeiten.
Header-Parameter
string
erforderlich
Format:
Authorization: Bearer API_KEY. Weitere Informationen finden Sie in der API-Übersicht.string
Profile Key eines Benutzerprofils.
string
erforderlich
Content-Type: multipart/form-dataBody-Parameter
object
Multipart-form-data-CSV-Datei mit geplanten Beiträgen. Siehe unten für die CSV-Vorlage.
Anfragebeispiele
Ein Multipart-form-data mit einer CSV-Datei von Beiträgen plant diese für ein zukünftiges Datum. Die CSV-Datei enthält die folgenden Felder (Vorlage unten), die alle erforderlich sind:post: Der Beitragstext.platforms: Durch Kommas getrennte Liste von Plattformen, z. B. „twitter, facebook, instagram”.mediaUrls: URL des Mediums, etwa eines Bildes oder Videos, das in den Beitrag aufgenommen werden soll.scheduleDate: Datum/Uhrzeit zur Planung des Beitrags im UTC-Format. Verwenden Sie beispielsweise das FormatYYYY-MM-DDThh:mm:ssZund senden Sie2026-07-08T12:30:00Z. Weitere Beispiele finden Sie unter utctime.
Planen Sie keine doppelten Beiträge im Abstand von weniger als 24 Stunden.Jeder Beitrag wird gegen ein 48-Stunden-Fenster geprüft, das um sein eigenes
scheduleDate zentriert ist — 24 Stunden davor bis 24 Stunden danach. Liegt in diesem Fenster ein weiterer Beitrag mit identischem oder nahezu identischem Text, wird der Beitrag mit Fehler 137 abgelehnt. Das Fenster reicht sowohl vorwärts als auch rückwärts, eine Zeile kann also auch wegen einer später geplanten Zeile abgelehnt werden. Die Prüfung erfolgt bereits beim Einreichen oder Planen eines Beitrags, nicht erst kurz vor der Veröffentlichung.
Dies dient dem Schutz Ihres Kontos bei den Netzwerken; sie können Konten mit häufigen doppelten Beiträgen sperren oder shadowbannen.CSV-Vorlage
Laden Sie die Vorlage herunter und speichern Sie sie als .csv-Datei. Ayrshare-CSV-Vorlagecurl \
-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"
}
]
}