curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"id": "s8k2jsk0pl", "scheduleDate": "2023-07-08T12:30:00Z", scheduledPause: true}' \
-X PATCH https://api.ayrshare.com/api/post
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/post", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
},
body: JSON.stringify({
id: "s8k2jsk0pl", // required
scheduleDate: "2023-07-08T12:30:00Z",
scheduledPause: true
}),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'id': 's8k2jsk0pl',
'scheduleDate': '2023-07-08T12:30:00Z'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.patch('https://api.ayrshare.com/api/post',
json=payload,
headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/post';
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
];
$data = json_encode([
'id' => 's8k2jsk0pl', // Replace with your actual post ID
'scheduleDate' => '2023-07-08T12:30:00Z'
]);
$curl = curl_init($apiUrl);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $data
]);
$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.Text;
using System.Threading.Tasks;
namespace PostUpdatePOSTRequest_csharp
{
class PostUpdate
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/post";
using (var httpClient = new HttpClient())
{
try
{
httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
string json = "{\"id\":\"s8k2jsk0pl\"," +
"\"scheduleDate\":\"2023-07-08T12:30:00Z\"}";
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await httpClient.PatchAsync(url, content);
var responseBody = await response.Content.ReadAsStringAsync();
response.EnsureSuccessStatusCode();
Console.WriteLine(responseBody);
}
catch (HttpRequestException ex)
{
Console.WriteLine("Error: " + ex.Message);
if (ex.InnerException != null)
{
Console.WriteLine("Error details: " + ex.InnerException.Message);
}
}
}
}
}
}
package main
import (
"bytes"
"encoding/json"
"log"
"net/http"
)
func main() {
message := map[string]interface{}{
"id": "s8k2jsk0pl",
"scheduleDate": "2023-07-08T12:30:00Z"
}
bytesRepresentation, err := json.Marshal(message)
if err != nil {
log.Fatalln(err)
}
req, _ := http.NewRequest("PATCH", "https://api.ayrshare.com/api/post",
bytes.NewBuffer(bytesRepresentation))
req.Header.Add("Content-Type", "application/json; charset=UTF-8")
req.Header.Add("Authorization", "Bearer API_KEY")
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal("Error:", err)
}
res.Body.Close()
}
{
"status": "success",
"id": "ZSU1tnnuykDy25wA6kvX", // Ayrshare Post ID
"scheduleDate": "2025-07-08T12:30:00Z",
"scheduledPaused": true
}
{
"action": "update",
"status": "error",
"code": 305,
"message": "Error updating post. Post ID not found."
}on
{
"action": "post",
"status": "error",
"code": 104,
"message": "Invalid schedule date format for scheduleDate. .../ayrshare.com/rest-api/endpoints/post#send-a-post"
}
Post
تحديث منشور
تحديث بيانات وصفية لمنشور مجدول
PATCH
/
post
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"id": "s8k2jsk0pl", "scheduleDate": "2023-07-08T12:30:00Z", scheduledPause: true}' \
-X PATCH https://api.ayrshare.com/api/post
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/post", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
},
body: JSON.stringify({
id: "s8k2jsk0pl", // required
scheduleDate: "2023-07-08T12:30:00Z",
scheduledPause: true
}),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'id': 's8k2jsk0pl',
'scheduleDate': '2023-07-08T12:30:00Z'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.patch('https://api.ayrshare.com/api/post',
json=payload,
headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/post';
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
];
$data = json_encode([
'id' => 's8k2jsk0pl', // Replace with your actual post ID
'scheduleDate' => '2023-07-08T12:30:00Z'
]);
$curl = curl_init($apiUrl);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $data
]);
$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.Text;
using System.Threading.Tasks;
namespace PostUpdatePOSTRequest_csharp
{
class PostUpdate
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/post";
using (var httpClient = new HttpClient())
{
try
{
httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
string json = "{\"id\":\"s8k2jsk0pl\"," +
"\"scheduleDate\":\"2023-07-08T12:30:00Z\"}";
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await httpClient.PatchAsync(url, content);
var responseBody = await response.Content.ReadAsStringAsync();
response.EnsureSuccessStatusCode();
Console.WriteLine(responseBody);
}
catch (HttpRequestException ex)
{
Console.WriteLine("Error: " + ex.Message);
if (ex.InnerException != null)
{
Console.WriteLine("Error details: " + ex.InnerException.Message);
}
}
}
}
}
}
package main
import (
"bytes"
"encoding/json"
"log"
"net/http"
)
func main() {
message := map[string]interface{}{
"id": "s8k2jsk0pl",
"scheduleDate": "2023-07-08T12:30:00Z"
}
bytesRepresentation, err := json.Marshal(message)
if err != nil {
log.Fatalln(err)
}
req, _ := http.NewRequest("PATCH", "https://api.ayrshare.com/api/post",
bytes.NewBuffer(bytesRepresentation))
req.Header.Add("Content-Type", "application/json; charset=UTF-8")
req.Header.Add("Authorization", "Bearer API_KEY")
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal("Error:", err)
}
res.Body.Close()
}
{
"status": "success",
"id": "ZSU1tnnuykDy25wA6kvX", // Ayrshare Post ID
"scheduleDate": "2025-07-08T12:30:00Z",
"scheduledPaused": true
}
{
"action": "update",
"status": "error",
"code": 305,
"message": "Error updating post. Post ID not found."
}on
{
"action": "post",
"status": "error",
"code": 104,
"message": "Invalid schedule date format for scheduleDate. .../ayrshare.com/rest-api/endpoints/post#send-a-post"
}
حدّث
scheduleDate لمنشور، أو حالة approval لمنشور، أو notes، أو visibility لفيديو YouTube منشور.
- يجب أن يكون للمنشور أصلًا
scheduleDateوأن يكون في حالة “pending”status. يمكن التحقق منstatusعبر نقاط نهاية /history أو GET /post. - يجب أن يكون فيديو YouTube قد نُشر بنجاح لتغيير الرؤية.
- يتطلب سير عمل الموافقة أن تكون الحالة الحالية للمنشور “awaiting approval”.
معاملات الترويسة
معاملات الجسم
يتطلب المنشور الأصلي الموافقة وحالته “awaiting approval”، عيّن إلى
true
للموافقة على المنشور ونشره.تفعيل أو تعطيل التعليقات على منشور. سيؤدي التعيين إلى
true إلى تعطيل التعليقات. سيؤدي التعيين إلى false إلى تفعيلها.المنصات المدعومة: Instagram وLinkedIn.- يمكن التفعيل أو التعطيل على منشور مجدول أو منشور منشور.
- تعطيل التعليقات على منشور منشور لن يحذف التعليقات الموجودة.
- تعطيل تعليقات LinkedIn سيحذف كل التعليقات الموجودة في الموضوع.
- لن تُحذف تعليقات Instagram.
- لا يمكن تغيير تعليقات TikTok بعد النشر.
عيّن ملاحظات على منشور يمكن استرجاعها عبر نقطة نهاية /history. الملاحظات
للرجوع فقط ولا تؤثر على المنشور.
الـ
datetime لجدولة منشور مستقبلي. يقبل تاريخًا ووقتًا بتوقيت UTC.مثلًا، استخدم التنسيق YYYY-MM-DDThh:mm:ssZ وأرسل بصيغة 2026-07-08T12:30:00Z.
راجع utctime لمزيد من الأمثلة.إذا كان التاريخ والوقت في الماضي، فسيُرسَل المنشور فورًا.
إيقاف مؤقت أو إلغاء الإيقاف المؤقت لمنشور مجدول. إذا أُلغي الإيقاف المؤقت لمنشور وكان
scheduleDate في الماضي،
فسيُنشر المنشور فورًا. فكّر في تحديث scheduleDate قبل إلغاء الإيقاف المؤقت.حدّث رؤية فيديو YouTube باستخدام حقل
visibility والقيم unlisted أو private أو public.حدّث description أو title أو categoryId. إذا لم يُعيَّن description أو categoryId أصلًا، فالقيم الافتراضية هي "" و24 (Entertainment) على التوالي.curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"id": "s8k2jsk0pl", "scheduleDate": "2023-07-08T12:30:00Z", scheduledPause: true}' \
-X PATCH https://api.ayrshare.com/api/post
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/post", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
},
body: JSON.stringify({
id: "s8k2jsk0pl", // required
scheduleDate: "2023-07-08T12:30:00Z",
scheduledPause: true
}),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'id': 's8k2jsk0pl',
'scheduleDate': '2023-07-08T12:30:00Z'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.patch('https://api.ayrshare.com/api/post',
json=payload,
headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/post';
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
];
$data = json_encode([
'id' => 's8k2jsk0pl', // Replace with your actual post ID
'scheduleDate' => '2023-07-08T12:30:00Z'
]);
$curl = curl_init($apiUrl);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $data
]);
$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.Text;
using System.Threading.Tasks;
namespace PostUpdatePOSTRequest_csharp
{
class PostUpdate
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/post";
using (var httpClient = new HttpClient())
{
try
{
httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
string json = "{\"id\":\"s8k2jsk0pl\"," +
"\"scheduleDate\":\"2023-07-08T12:30:00Z\"}";
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await httpClient.PatchAsync(url, content);
var responseBody = await response.Content.ReadAsStringAsync();
response.EnsureSuccessStatusCode();
Console.WriteLine(responseBody);
}
catch (HttpRequestException ex)
{
Console.WriteLine("Error: " + ex.Message);
if (ex.InnerException != null)
{
Console.WriteLine("Error details: " + ex.InnerException.Message);
}
}
}
}
}
}
package main
import (
"bytes"
"encoding/json"
"log"
"net/http"
)
func main() {
message := map[string]interface{}{
"id": "s8k2jsk0pl",
"scheduleDate": "2023-07-08T12:30:00Z"
}
bytesRepresentation, err := json.Marshal(message)
if err != nil {
log.Fatalln(err)
}
req, _ := http.NewRequest("PATCH", "https://api.ayrshare.com/api/post",
bytes.NewBuffer(bytesRepresentation))
req.Header.Add("Content-Type", "application/json; charset=UTF-8")
req.Header.Add("Authorization", "Bearer API_KEY")
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal("Error:", err)
}
res.Body.Close()
}
{
"status": "success",
"id": "ZSU1tnnuykDy25wA6kvX", // Ayrshare Post ID
"scheduleDate": "2025-07-08T12:30:00Z",
"scheduledPaused": true
}
{
"action": "update",
"status": "error",
"code": 305,
"message": "Error updating post. Post ID not found."
}on
{
"action": "post",
"status": "error",
"code": 104,
"message": "Invalid schedule date format for scheduleDate. .../ayrshare.com/rest-api/endpoints/post#send-a-post"
}
⌘I
