curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"id": "s8k2jsk0pl"}' \
-X PUT https://api.ayrshare.com/api/post/retry
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/post/retry", {
method: "PUT",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${API_KEY}`
},
body: JSON.stringify({
id: "s8k2jsk0pl" // required
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'id': 's8k2jsk0pl'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.put('https://api.ayrshare.com/api/post/retry',
json=payload,
headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/post/retry';
$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 ID
]);
$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 PostRetryPOSTRequest_csharp
{
class PostRetry
{
private static readonly HttpClient client = new HttpClient();
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/post/retry";
// Set up request headers
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
// Prepare JSON content
string json = "{\"id\": \"s8k2jsk0pl\"}";
var content = new StringContent(json, Encoding.UTF8, "application/json");
try
{
// Send PATCH request
HttpResponseMessage response = await client.PutAsync(url, content);
response.EnsureSuccessStatusCode();
// Read response
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
package main
import (
"bytes"
"encoding/json"
"log"
"net/http"
)
func main() {
message := map[string]interface{}{
"id": "s8k2jsk0pl"
}
bytesRepresentation, err := json.Marshal(message)
if err != nil {
log.Fatalln(err)
}
req, _ := http.NewRequest("PUT", "https://api.ayrshare.com/api/post/retry",
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": "pending", // पोस्ट retried किया जाएगा
"id": "N7kaDiZAfwc544OBKlgc" // Ayrshare Post ID
}
{
"action": "post",
"status": "error",
"code": 329,
"message": "This post was already retried and cannot be retried again."
}
Post
पोस्ट को Retry करें
उस पोस्ट को प्रकाशित करने का पुनः प्रयास करें जो विफल हो गया
PUT
/
post
/
retry
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"id": "s8k2jsk0pl"}' \
-X PUT https://api.ayrshare.com/api/post/retry
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/post/retry", {
method: "PUT",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${API_KEY}`
},
body: JSON.stringify({
id: "s8k2jsk0pl" // required
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'id': 's8k2jsk0pl'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.put('https://api.ayrshare.com/api/post/retry',
json=payload,
headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/post/retry';
$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 ID
]);
$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 PostRetryPOSTRequest_csharp
{
class PostRetry
{
private static readonly HttpClient client = new HttpClient();
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/post/retry";
// Set up request headers
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
// Prepare JSON content
string json = "{\"id\": \"s8k2jsk0pl\"}";
var content = new StringContent(json, Encoding.UTF8, "application/json");
try
{
// Send PATCH request
HttpResponseMessage response = await client.PutAsync(url, content);
response.EnsureSuccessStatusCode();
// Read response
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
package main
import (
"bytes"
"encoding/json"
"log"
"net/http"
)
func main() {
message := map[string]interface{}{
"id": "s8k2jsk0pl"
}
bytesRepresentation, err := json.Marshal(message)
if err != nil {
log.Fatalln(err)
}
req, _ := http.NewRequest("PUT", "https://api.ayrshare.com/api/post/retry",
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": "pending", // पोस्ट retried किया जाएगा
"id": "N7kaDiZAfwc544OBKlgc" // Ayrshare Post ID
}
{
"action": "post",
"status": "error",
"code": 329,
"message": "This post was already retried and cannot be retried again."
}
"error" status के साथ विफल हुए पोस्ट को प्रकाशित करने का पुनः प्रयास करें। Retried post को एक scheduled post के रूप में माना जाएगा, इसलिए अंतिम स्थिति /history endpoint या scheduled action webhook के माध्यम से प्राप्त की जा सकती है।
जब पोस्ट retried किया जा रहा है, status "pending" होगा। आप GET post endpoint call करके retry की स्थिति जाँच सकते हैं।
पोस्ट को केवल एक बार retried किया जा सकता है। केवल तभी उपयोग करने की सलाह दी जाती है जब error message इंगित करे कि retry संभव है।
किसी failed social media post को retry करते समय, पहले verify करें कि पोस्ट पहले से प्रकाशित नहीं हो चुका है।
Social networks कभी-कभी errors report कर सकते हैं भले ही उन्होंने पोस्ट को सफलतापूर्वक process और प्रकाशित कर दिया हो।
Header Parameters
Body Parameters
Top-level Ayrshare Post ID। मूल पोस्ट की स्थिति “error” होनी चाहिए।
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"id": "s8k2jsk0pl"}' \
-X PUT https://api.ayrshare.com/api/post/retry
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/post/retry", {
method: "PUT",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${API_KEY}`
},
body: JSON.stringify({
id: "s8k2jsk0pl" // required
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'id': 's8k2jsk0pl'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.put('https://api.ayrshare.com/api/post/retry',
json=payload,
headers=headers)
print(r.json())
<?php
$apiUrl = 'https://api.ayrshare.com/api/post/retry';
$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 ID
]);
$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 PostRetryPOSTRequest_csharp
{
class PostRetry
{
private static readonly HttpClient client = new HttpClient();
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string url = "https://api.ayrshare.com/api/post/retry";
// Set up request headers
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
// Prepare JSON content
string json = "{\"id\": \"s8k2jsk0pl\"}";
var content = new StringContent(json, Encoding.UTF8, "application/json");
try
{
// Send PATCH request
HttpResponseMessage response = await client.PutAsync(url, content);
response.EnsureSuccessStatusCode();
// Read response
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
package main
import (
"bytes"
"encoding/json"
"log"
"net/http"
)
func main() {
message := map[string]interface{}{
"id": "s8k2jsk0pl"
}
bytesRepresentation, err := json.Marshal(message)
if err != nil {
log.Fatalln(err)
}
req, _ := http.NewRequest("PUT", "https://api.ayrshare.com/api/post/retry",
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": "pending", // पोस्ट retried किया जाएगा
"id": "N7kaDiZAfwc544OBKlgc" // Ayrshare Post ID
}
{
"action": "post",
"status": "error",
"code": 329,
"message": "This post was already retried and cannot be retried again."
}
⌘I
