auto-schedule
Create a schedule for future posts.
Click the β€Ί in the endpoint to view details.
post
https://app.ayrshare.com/api
/auto-schedule/set
Set Auto Schedule

Request Examples

cURL
Node.js
Python
PHP
Go
1
curl \
2
-H "Authorization: Bearer API_KEY" \
3
-H 'Content-Type: application/json' \
4
-d '{"schedule": ["13:05Z", "20:14Z"], "title": "Instagram Schedule"}' \
5
-X POST https://app.ayrshare.com/api/auto-schedule/set
Copied!
1
const fetch = require("node-fetch");
2
const API_KEY = "API_KEY";
3
​
4
fetch("https://app.ayrshare.com/api/auto-schedule/set", {
5
method: "POST",
6
headers: {
7
"Content-Type": "application/json",
8
"Authorization": `Bearer ${API_KEY}`
9
},
10
body: JSON.stringify({
11
schedule: ["13:05Z", "20:14Z"], // required
12
title: "Instagram Schedule" // optional
13
}),
14
})
15
.then((res) => res.json())
16
.then((json) => console.log(json))
17
.catch(console.error);
Copied!
1
import requests
2
​
3
payload = {'schedule': ['13:05Z', '20:14Z'], 'title': 'Instagram Schedule'}
4
headers = {'Content-Type': 'application/json',
5
'Authorization': 'Bearer API_KEY'}
6
​
7
r = requests.post('https://app.ayrshare.com/api/auto-schedule/set',
8
json=payload,
9
headers=headers)
10
11
print(r.json())
Copied!
1
<?php
2
require 'vendor/autoload.php'; // Composer auto-loader
3
​
4
$client = new GuzzleHttp\Client();
5
$res = $client->request(
6
'POST',
7
'https://app.ayrshare.com/api/auto-schedule/set',
8
[
9
'headers' => [
10
'Content-Type' => 'application/json',
11
'Authorization' => 'Bearer API_KEY'
12
],
13
'json' => [
14
'schedule' => ["13:05Z", "20:14Z"], // required
15
'title' => "Instagram Schedule" // optional
16
​
17
]
18
]
19
);
20
​
21
echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);
Copied!
1
package main
2
​
3
import (
4
"bytes"
5
"encoding/json"
6
"log"
7
"net/http"
8
)
9
​
10
func main() {
11
message := map[string]interface{}{
12
"schedule": []string{"13:05Z", "20:14Z"},
13
"title": "Instagram Schedule"
14
}
15
​
16
bytesRepresentation, err := json.Marshal(message)
17
if err != nil {
18
log.Fatalln(err)
19
}
20
​
21
req, _ := http.NewRequest("POST", "https://app.ayrshare.com/api/auto-schedule/set",
22
bytes.NewBuffer(bytesRepresentation))
23
​
24
req.Header.Add("Content-Type", "application/json; charset=UTF-8")
25
req.Header.Add("Authorization", "Bearer API_KEY")
26
​
27
res, err := http.DefaultClient.Do(req)
28
if err != nil {
29
log.Fatal("Error:", err)
30
}
31
​
32
res.Body.Close()
33
}
Copied!
​
delete
https://app.ayrshare.com/api
/auto-schedule/delete
Delete Auto Schedule

Request Examples

cURL
Node.js
Python
PHP
C#
1
curl \
2
-H "Authorization: Bearer API Key" \
3
-H 'Content-Type: application/json' \
4
-d '{"title": "Schedule Title"}' \
5
-X DELETE https://app.ayrshare.com/api/auto-schedule/delete
Copied!
1
const fetch = require("node-fetch");
2
const API_KEY = "API_KEY";
3
const title = "Schedule Title";
4
​
5
fetch("https://app.ayrshare.com/api/delete", {
6
method: "DELETE",
7
headers: {
8
"Content-Type": "application/json",
9
"Authorization": `Bearer ${API_KEY}`
10
},
11
body: JSON.stringify({ title }),
12
})
13
.then((res) => res.json())
14
.then((json) => console.log(json))
15
.catch(console.error);
Copied!
1
import requests
2
​
3
payload = {'title': 'Schedule Title'}
4
headers = {'Content-Type': 'application/json',
5
'Authorization': 'Bearer API_KEY'}
6
​
7
r = requests.delete('https://app.ayrshare.com/api/delete',
8
json=payload,
9
headers=headers)
10
11
print(r.json())
Copied!
1
<?php
2
require 'vendor/autoload.php'; // Composer auto-loader
3
​
4
$client = new GuzzleHttp\Client();
5
$res = $client->request(
6
'DELETE',
7
'https://app.ayrshare.com/api/delete',
8
[
9
'headers' => [
10
'Content-Type' => 'application/json',
11
'Authorization' => 'Bearer API_KEY'
12
],
13
'json' => [
14
'title' => ['Schedule Title']
15
]
16
]
17
);
18
​
19
echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);
Copied!
1
using System;
2
using System.Net;
3
using System.IO;
4
​
5
namespace DeletePOSTRequest_charp
6
{
7
class Delete
8
{
9
static void Main(string[] args)
10
{
11
string API_KEY = "API_KEY";
12
string url = "https://app.ayrshare.com/api/delete";
13
​
14
var httpWebRequest = WebRequest.CreateHttp(url);
15
httpWebRequest.ContentType = "application/json";
16
httpWebRequest.Method = "DELETE";
17
httpWebRequest.Headers.Add("Authorization", "Bearer " + API_KEY);
18
​
19
using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
20
{
21
string json = "{\"title\" : \"Schedule Title\"}";
22
​
23
streamWriter.Write(json);
24
streamWriter.Flush();
25
}
26
​
27
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
28
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
29
{
30
var response = streamReader.ReadToEnd();
31
Console.WriteLine(response);
32
}
33
}
34
}
35
}
Copied!
​
get
https://app.ayrshare.com/api
/auto-schedule/list
List Auto Schedule

Request Examples

cURL
Node.js
Python
PHP
C#
1
curl \
2
-H "Authorization: Bearer API_KEY" \
3
-X GET https://app.ayrshare.com/api/auto-schedule/list
Copied!
1
const fetch = require("node-fetch");
2
const API_KEY = "API_KEY";
3
​
4
fetch("https://app.ayrshare.com/api/auto-schedule/list", {
5
method: "GET",
6
headers: {
7
"Authorization": `Bearer ${API_KEY}`
8
}
9
})
10
.then((res) => res.json())
11
.then((json) => console.log(json))
12
.catch(console.error);
Copied!
1
import requests
2
​
3
headers = {'Authorization': 'Bearer API_KEY'}
4
​
5
r = requests.get('https://app.ayrshare.com/api/auto-schedule/list', headers=headers)
6
7
print(r.json())
Copied!
1
<?php
2
require 'vendor/autoload.php'; // Composer auto-loader
3
​
4
$client = new GuzzleHttp\Client();
5
$res = $client->request(
6
'GET',
7
'https://app.ayrshare.com/api/auto-schedule/list',
8
[
9
'headers' => [
10
'Content-Type' => 'application/json',
11
'Authorization' => 'Bearer API_KEY'
12
]
13
]
14
);
15
​
16
echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);
Copied!
1
using System;
2
using System.Net;
3
using System.IO;
4
​
5
namespace UserGETRequest_charp
6
{
7
class User
8
{
9
static void Main(string[] args)
10
{
11
string API_KEY = "API_KEY";
12
string url = "https://app.ayrshare.com/api/auto-schedule/list";
13
​
14
var httpWebRequest = WebRequest.CreateHttp(url);
15
httpWebRequest.ContentType = "application/json";
16
httpWebRequest.Headers.Add("Authorization", "Bearer " + API_KEY);
17
​
18
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
19
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
20
{
21
var response = streamReader.ReadToEnd();
22
Console.WriteLine(response);
23
}
24
}
25
}
26
}
Copied!
Last modified 12d ago