curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/post/TBEAAqAMMJoweA9wKHUl
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/post/TBEAAqAMMJoweA9wKHUl", {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.get('https://api.ayrshare.com/api/post/TBEAAqAMMJoweA9wKHUl', headers=headers)
print(r.json())
<?php
// URL and authorization details
$url = 'https://api.ayrshare.com/api/post/TBEAAqAMMJoweA9wKHUl';
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
// Initialize a cURL session
$curl = curl_init();
// Set cURL options
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey
));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Execute cURL session and get the response
$response = curl_exec($curl);
// Check if any error occurred
if(curl_errno($curl)){
echo 'Curl error: ' . curl_error($curl);
} else {
// Decode and re-encode the JSON response to pretty print
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
// Close cURL session
curl_close($curl);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace PostGETRequest_csharp
{
class Post
{
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/TBEAAqAMMJoweA9wKHUl";
// Set up request headers
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
try
{
// Send GET request and read response
HttpResponseMessage response = await client.GetAsync(url);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
{
"created": "2024-11-19T19:00:14Z",
"errors": [],
"id": "8tNTr73VV8Y66bHwC2322",
"mediaUrls": [
"https://img.ayrshare.com/012/gb.jpg"
],
"platforms": [
"twitter"
],
"post": "#75304 Eighty percent of success is showing up. - John D. Rockefeller",
"postIds": [
{
"status": "success",
"id": "1858948421974925758",
"postUrl": "https://twitter.com/wondrouswaffles/status/185894842197493444",
"platform": "twitter"
}
],
"profileTitle": "Best Profile",
"refId": "b68bdcabb379be2cf1186c1e59544",
"scheduleDate": "2024-11-19T19:00:14Z",
"shortenLinks": false,
"status": "success",
"type": "now"
}
{
"action": "history",
"status": "error",
"code": 221,
"message": "History not found.",
"id": "4W3f3RPr6QSrw8S5Yo8"
}
Post
पोस्ट प्राप्त करें
Ayrshare Post ID द्वारा एक पोस्ट प्राप्त करें
GET
/
post
/
:id
curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/post/TBEAAqAMMJoweA9wKHUl
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/post/TBEAAqAMMJoweA9wKHUl", {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.get('https://api.ayrshare.com/api/post/TBEAAqAMMJoweA9wKHUl', headers=headers)
print(r.json())
<?php
// URL and authorization details
$url = 'https://api.ayrshare.com/api/post/TBEAAqAMMJoweA9wKHUl';
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
// Initialize a cURL session
$curl = curl_init();
// Set cURL options
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey
));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Execute cURL session and get the response
$response = curl_exec($curl);
// Check if any error occurred
if(curl_errno($curl)){
echo 'Curl error: ' . curl_error($curl);
} else {
// Decode and re-encode the JSON response to pretty print
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
// Close cURL session
curl_close($curl);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace PostGETRequest_csharp
{
class Post
{
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/TBEAAqAMMJoweA9wKHUl";
// Set up request headers
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
try
{
// Send GET request and read response
HttpResponseMessage response = await client.GetAsync(url);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
{
"created": "2024-11-19T19:00:14Z",
"errors": [],
"id": "8tNTr73VV8Y66bHwC2322",
"mediaUrls": [
"https://img.ayrshare.com/012/gb.jpg"
],
"platforms": [
"twitter"
],
"post": "#75304 Eighty percent of success is showing up. - John D. Rockefeller",
"postIds": [
{
"status": "success",
"id": "1858948421974925758",
"postUrl": "https://twitter.com/wondrouswaffles/status/185894842197493444",
"platform": "twitter"
}
],
"profileTitle": "Best Profile",
"refId": "b68bdcabb379be2cf1186c1e59544",
"scheduleDate": "2024-11-19T19:00:14Z",
"shortenLinks": false,
"status": "success",
"type": "now"
}
{
"action": "history",
"status": "error",
"code": 221,
"message": "History not found.",
"id": "4W3f3RPr6QSrw8S5Yo8"
}
Ayrshare के माध्यम से भेजी गई विशिष्ट पोस्ट का इतिहास प्राप्त करें। स्थिति, पोस्ट parameters, और अन्य विवरण लौटाता है।
:id को Ayrshare Post ID से बदलें।
उसी डेटा के लिए /history by id endpoint को कॉल करें।
पोस्ट स्थितियाँ
एक पोस्ट के लिए निम्नलिखित स्थितियाँ लौटाई जाती हैं।| स्थिति | विवरण |
|---|---|
awaiting approval | पोस्ट्स approval workflow के माध्यम से approve होने की प्रतीक्षा में हैं। |
deleted | पोस्ट हटा दी गई है। नोट: हटाई गई पोस्ट्स केवल status query filter के साथ लौटाई जाती हैं। कृपया नीचे देखें। |
error | एक या अधिक सोशल नेटवर्क के साथ एक त्रुटि हुई। |
pending | पोस्ट अभी तक प्रोसेस नहीं की गई है। सामान्यतः एक scheduled पोस्ट। |
success | पोस्ट सभी सोशल नेटवर्क पर सफलतापूर्वक भेज दी गई थी। |
Ayrshare के माध्यम से न भेजे गए पोस्ट्स सहित सभी पोस्ट्स प्राप्त करने के लिए /history
endpoint देखें।
Header Parameters
Path Parameters
/post से Ayrshare Post ID
curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/post/TBEAAqAMMJoweA9wKHUl
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/post/TBEAAqAMMJoweA9wKHUl", {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.get('https://api.ayrshare.com/api/post/TBEAAqAMMJoweA9wKHUl', headers=headers)
print(r.json())
<?php
// URL and authorization details
$url = 'https://api.ayrshare.com/api/post/TBEAAqAMMJoweA9wKHUl';
$apiKey = 'API_KEY'; // Replace 'API_KEY' with your actual API key
// Initialize a cURL session
$curl = curl_init();
// Set cURL options
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey
));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Execute cURL session and get the response
$response = curl_exec($curl);
// Check if any error occurred
if(curl_errno($curl)){
echo 'Curl error: ' . curl_error($curl);
} else {
// Decode and re-encode the JSON response to pretty print
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
// Close cURL session
curl_close($curl);
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace PostGETRequest_csharp
{
class Post
{
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/TBEAAqAMMJoweA9wKHUl";
// Set up request headers
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
try
{
// Send GET request and read response
HttpResponseMessage response = await client.GetAsync(url);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
{
"created": "2024-11-19T19:00:14Z",
"errors": [],
"id": "8tNTr73VV8Y66bHwC2322",
"mediaUrls": [
"https://img.ayrshare.com/012/gb.jpg"
],
"platforms": [
"twitter"
],
"post": "#75304 Eighty percent of success is showing up. - John D. Rockefeller",
"postIds": [
{
"status": "success",
"id": "1858948421974925758",
"postUrl": "https://twitter.com/wondrouswaffles/status/185894842197493444",
"platform": "twitter"
}
],
"profileTitle": "Best Profile",
"refId": "b68bdcabb379be2cf1186c1e59544",
"scheduleDate": "2024-11-19T19:00:14Z",
"shortenLinks": false,
"status": "success",
"type": "now"
}
{
"action": "history",
"status": "error",
"code": 221,
"message": "History not found.",
"id": "4W3f3RPr6QSrw8S5Yo8"
}
⌘I
