Create a post
curl --request POST \
--url https://api.partoo.co/v2/posts \
--header 'Content-Type: application/json' \
--header 'x-APIKey: <api-key>' \
--data '
{
"business_search": {
"business__in": [
[
"5409c35a97bbc544d8e26737",
"595badaef348ab6b3530033f",
"59d53302b12ff6429f262639"
]
]
},
"publishers": [
"google_my_business",
"facebook",
"instagram"
],
"data": {
"summary": "Wonderful post summary !",
"image_url": [
"https://example.com/1.png",
"https://example.com/2.png"
],
"title": "Great post title !",
"link": {
"use_business_url": true,
"custom_url": "<string>"
},
"schedule_time": "2050-01-01T09:00:00",
"expiration_time": "2050-01-01T09:00:00",
"coupon_code": "PROMO25",
"offer_terms": "These are the conditions",
"start_at": "2050-01-01T09:00:00",
"end_at": "2050-01-01T09:00:00"
},
"is_draft": false,
"send_notifications": false
}
'import requests
url = "https://api.partoo.co/v2/posts"
payload = {
"business_search": { "business__in": [["5409c35a97bbc544d8e26737", "595badaef348ab6b3530033f", "59d53302b12ff6429f262639"]] },
"publishers": ["google_my_business", "facebook", "instagram"],
"data": {
"summary": "Wonderful post summary !",
"image_url": ["https://example.com/1.png", "https://example.com/2.png"],
"title": "Great post title !",
"link": {
"use_business_url": True,
"custom_url": "<string>"
},
"schedule_time": "2050-01-01T09:00:00",
"expiration_time": "2050-01-01T09:00:00",
"coupon_code": "PROMO25",
"offer_terms": "These are the conditions",
"start_at": "2050-01-01T09:00:00",
"end_at": "2050-01-01T09:00:00"
},
"is_draft": False,
"send_notifications": False
}
headers = {
"x-APIKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-APIKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
business_search: {
business__in: [
[
'5409c35a97bbc544d8e26737',
'595badaef348ab6b3530033f',
'59d53302b12ff6429f262639'
]
]
},
publishers: ['google_my_business', 'facebook', 'instagram'],
data: {
summary: 'Wonderful post summary !',
image_url: ['https://example.com/1.png', 'https://example.com/2.png'],
title: 'Great post title !',
link: {use_business_url: true, custom_url: '<string>'},
schedule_time: '2050-01-01T09:00:00',
expiration_time: '2050-01-01T09:00:00',
coupon_code: 'PROMO25',
offer_terms: 'These are the conditions',
start_at: '2050-01-01T09:00:00',
end_at: '2050-01-01T09:00:00'
},
is_draft: false,
send_notifications: false
})
};
fetch('https://api.partoo.co/v2/posts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.partoo.co/v2/posts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'business_search' => [
'business__in' => [
[
'5409c35a97bbc544d8e26737',
'595badaef348ab6b3530033f',
'59d53302b12ff6429f262639'
]
]
],
'publishers' => [
'google_my_business',
'facebook',
'instagram'
],
'data' => [
'summary' => 'Wonderful post summary !',
'image_url' => [
'https://example.com/1.png',
'https://example.com/2.png'
],
'title' => 'Great post title !',
'link' => [
'use_business_url' => true,
'custom_url' => '<string>'
],
'schedule_time' => '2050-01-01T09:00:00',
'expiration_time' => '2050-01-01T09:00:00',
'coupon_code' => 'PROMO25',
'offer_terms' => 'These are the conditions',
'start_at' => '2050-01-01T09:00:00',
'end_at' => '2050-01-01T09:00:00'
],
'is_draft' => false,
'send_notifications' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-APIKey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.partoo.co/v2/posts"
payload := strings.NewReader("{\n \"business_search\": {\n \"business__in\": [\n [\n \"5409c35a97bbc544d8e26737\",\n \"595badaef348ab6b3530033f\",\n \"59d53302b12ff6429f262639\"\n ]\n ]\n },\n \"publishers\": [\n \"google_my_business\",\n \"facebook\",\n \"instagram\"\n ],\n \"data\": {\n \"summary\": \"Wonderful post summary !\",\n \"image_url\": [\n \"https://example.com/1.png\",\n \"https://example.com/2.png\"\n ],\n \"title\": \"Great post title !\",\n \"link\": {\n \"use_business_url\": true,\n \"custom_url\": \"<string>\"\n },\n \"schedule_time\": \"2050-01-01T09:00:00\",\n \"expiration_time\": \"2050-01-01T09:00:00\",\n \"coupon_code\": \"PROMO25\",\n \"offer_terms\": \"These are the conditions\",\n \"start_at\": \"2050-01-01T09:00:00\",\n \"end_at\": \"2050-01-01T09:00:00\"\n },\n \"is_draft\": false,\n \"send_notifications\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-APIKey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.partoo.co/v2/posts")
.header("x-APIKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"business_search\": {\n \"business__in\": [\n [\n \"5409c35a97bbc544d8e26737\",\n \"595badaef348ab6b3530033f\",\n \"59d53302b12ff6429f262639\"\n ]\n ]\n },\n \"publishers\": [\n \"google_my_business\",\n \"facebook\",\n \"instagram\"\n ],\n \"data\": {\n \"summary\": \"Wonderful post summary !\",\n \"image_url\": [\n \"https://example.com/1.png\",\n \"https://example.com/2.png\"\n ],\n \"title\": \"Great post title !\",\n \"link\": {\n \"use_business_url\": true,\n \"custom_url\": \"<string>\"\n },\n \"schedule_time\": \"2050-01-01T09:00:00\",\n \"expiration_time\": \"2050-01-01T09:00:00\",\n \"coupon_code\": \"PROMO25\",\n \"offer_terms\": \"These are the conditions\",\n \"start_at\": \"2050-01-01T09:00:00\",\n \"end_at\": \"2050-01-01T09:00:00\"\n },\n \"is_draft\": false,\n \"send_notifications\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.partoo.co/v2/posts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-APIKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"business_search\": {\n \"business__in\": [\n [\n \"5409c35a97bbc544d8e26737\",\n \"595badaef348ab6b3530033f\",\n \"59d53302b12ff6429f262639\"\n ]\n ]\n },\n \"publishers\": [\n \"google_my_business\",\n \"facebook\",\n \"instagram\"\n ],\n \"data\": {\n \"summary\": \"Wonderful post summary !\",\n \"image_url\": [\n \"https://example.com/1.png\",\n \"https://example.com/2.png\"\n ],\n \"title\": \"Great post title !\",\n \"link\": {\n \"use_business_url\": true,\n \"custom_url\": \"<string>\"\n },\n \"schedule_time\": \"2050-01-01T09:00:00\",\n \"expiration_time\": \"2050-01-01T09:00:00\",\n \"coupon_code\": \"PROMO25\",\n \"offer_terms\": \"These are the conditions\",\n \"start_at\": \"2050-01-01T09:00:00\",\n \"end_at\": \"2050-01-01T09:00:00\"\n },\n \"is_draft\": false,\n \"send_notifications\": false\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"code": 200,
"message": "2 posts have been created.",
"ids": "45,46",
"data": [
{
"post_id": 101,
"business_id": "1234567890"
},
{
"post_id": 102,
"business_id": "1234567891"
}
]
}{
"errors": {
"authentication": "User not authenticated"
}
}{
"errors": {
"authorization": "Operation not allowed"
}
}{
"errors": {
"json": "Resource not found"
}
}Posts
Create a post
This endpoint lets you create a post or a draft post on Google / Facebook / Instagram.
The creation of a post will not happen in real time and might take a few minutes.
A draft post can only be created by Org Admins and is not immediately published. An expiration date must be specified when creating a draft post. In order to be published, a draft needs to be updated by a BM/GM user before the expiration date.
POST
/
posts
Create a post
curl --request POST \
--url https://api.partoo.co/v2/posts \
--header 'Content-Type: application/json' \
--header 'x-APIKey: <api-key>' \
--data '
{
"business_search": {
"business__in": [
[
"5409c35a97bbc544d8e26737",
"595badaef348ab6b3530033f",
"59d53302b12ff6429f262639"
]
]
},
"publishers": [
"google_my_business",
"facebook",
"instagram"
],
"data": {
"summary": "Wonderful post summary !",
"image_url": [
"https://example.com/1.png",
"https://example.com/2.png"
],
"title": "Great post title !",
"link": {
"use_business_url": true,
"custom_url": "<string>"
},
"schedule_time": "2050-01-01T09:00:00",
"expiration_time": "2050-01-01T09:00:00",
"coupon_code": "PROMO25",
"offer_terms": "These are the conditions",
"start_at": "2050-01-01T09:00:00",
"end_at": "2050-01-01T09:00:00"
},
"is_draft": false,
"send_notifications": false
}
'import requests
url = "https://api.partoo.co/v2/posts"
payload = {
"business_search": { "business__in": [["5409c35a97bbc544d8e26737", "595badaef348ab6b3530033f", "59d53302b12ff6429f262639"]] },
"publishers": ["google_my_business", "facebook", "instagram"],
"data": {
"summary": "Wonderful post summary !",
"image_url": ["https://example.com/1.png", "https://example.com/2.png"],
"title": "Great post title !",
"link": {
"use_business_url": True,
"custom_url": "<string>"
},
"schedule_time": "2050-01-01T09:00:00",
"expiration_time": "2050-01-01T09:00:00",
"coupon_code": "PROMO25",
"offer_terms": "These are the conditions",
"start_at": "2050-01-01T09:00:00",
"end_at": "2050-01-01T09:00:00"
},
"is_draft": False,
"send_notifications": False
}
headers = {
"x-APIKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-APIKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
business_search: {
business__in: [
[
'5409c35a97bbc544d8e26737',
'595badaef348ab6b3530033f',
'59d53302b12ff6429f262639'
]
]
},
publishers: ['google_my_business', 'facebook', 'instagram'],
data: {
summary: 'Wonderful post summary !',
image_url: ['https://example.com/1.png', 'https://example.com/2.png'],
title: 'Great post title !',
link: {use_business_url: true, custom_url: '<string>'},
schedule_time: '2050-01-01T09:00:00',
expiration_time: '2050-01-01T09:00:00',
coupon_code: 'PROMO25',
offer_terms: 'These are the conditions',
start_at: '2050-01-01T09:00:00',
end_at: '2050-01-01T09:00:00'
},
is_draft: false,
send_notifications: false
})
};
fetch('https://api.partoo.co/v2/posts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.partoo.co/v2/posts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'business_search' => [
'business__in' => [
[
'5409c35a97bbc544d8e26737',
'595badaef348ab6b3530033f',
'59d53302b12ff6429f262639'
]
]
],
'publishers' => [
'google_my_business',
'facebook',
'instagram'
],
'data' => [
'summary' => 'Wonderful post summary !',
'image_url' => [
'https://example.com/1.png',
'https://example.com/2.png'
],
'title' => 'Great post title !',
'link' => [
'use_business_url' => true,
'custom_url' => '<string>'
],
'schedule_time' => '2050-01-01T09:00:00',
'expiration_time' => '2050-01-01T09:00:00',
'coupon_code' => 'PROMO25',
'offer_terms' => 'These are the conditions',
'start_at' => '2050-01-01T09:00:00',
'end_at' => '2050-01-01T09:00:00'
],
'is_draft' => false,
'send_notifications' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-APIKey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.partoo.co/v2/posts"
payload := strings.NewReader("{\n \"business_search\": {\n \"business__in\": [\n [\n \"5409c35a97bbc544d8e26737\",\n \"595badaef348ab6b3530033f\",\n \"59d53302b12ff6429f262639\"\n ]\n ]\n },\n \"publishers\": [\n \"google_my_business\",\n \"facebook\",\n \"instagram\"\n ],\n \"data\": {\n \"summary\": \"Wonderful post summary !\",\n \"image_url\": [\n \"https://example.com/1.png\",\n \"https://example.com/2.png\"\n ],\n \"title\": \"Great post title !\",\n \"link\": {\n \"use_business_url\": true,\n \"custom_url\": \"<string>\"\n },\n \"schedule_time\": \"2050-01-01T09:00:00\",\n \"expiration_time\": \"2050-01-01T09:00:00\",\n \"coupon_code\": \"PROMO25\",\n \"offer_terms\": \"These are the conditions\",\n \"start_at\": \"2050-01-01T09:00:00\",\n \"end_at\": \"2050-01-01T09:00:00\"\n },\n \"is_draft\": false,\n \"send_notifications\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-APIKey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.partoo.co/v2/posts")
.header("x-APIKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"business_search\": {\n \"business__in\": [\n [\n \"5409c35a97bbc544d8e26737\",\n \"595badaef348ab6b3530033f\",\n \"59d53302b12ff6429f262639\"\n ]\n ]\n },\n \"publishers\": [\n \"google_my_business\",\n \"facebook\",\n \"instagram\"\n ],\n \"data\": {\n \"summary\": \"Wonderful post summary !\",\n \"image_url\": [\n \"https://example.com/1.png\",\n \"https://example.com/2.png\"\n ],\n \"title\": \"Great post title !\",\n \"link\": {\n \"use_business_url\": true,\n \"custom_url\": \"<string>\"\n },\n \"schedule_time\": \"2050-01-01T09:00:00\",\n \"expiration_time\": \"2050-01-01T09:00:00\",\n \"coupon_code\": \"PROMO25\",\n \"offer_terms\": \"These are the conditions\",\n \"start_at\": \"2050-01-01T09:00:00\",\n \"end_at\": \"2050-01-01T09:00:00\"\n },\n \"is_draft\": false,\n \"send_notifications\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.partoo.co/v2/posts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-APIKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"business_search\": {\n \"business__in\": [\n [\n \"5409c35a97bbc544d8e26737\",\n \"595badaef348ab6b3530033f\",\n \"59d53302b12ff6429f262639\"\n ]\n ]\n },\n \"publishers\": [\n \"google_my_business\",\n \"facebook\",\n \"instagram\"\n ],\n \"data\": {\n \"summary\": \"Wonderful post summary !\",\n \"image_url\": [\n \"https://example.com/1.png\",\n \"https://example.com/2.png\"\n ],\n \"title\": \"Great post title !\",\n \"link\": {\n \"use_business_url\": true,\n \"custom_url\": \"<string>\"\n },\n \"schedule_time\": \"2050-01-01T09:00:00\",\n \"expiration_time\": \"2050-01-01T09:00:00\",\n \"coupon_code\": \"PROMO25\",\n \"offer_terms\": \"These are the conditions\",\n \"start_at\": \"2050-01-01T09:00:00\",\n \"end_at\": \"2050-01-01T09:00:00\"\n },\n \"is_draft\": false,\n \"send_notifications\": false\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"code": 200,
"message": "2 posts have been created.",
"ids": "45,46",
"data": [
{
"post_id": 101,
"business_id": "1234567890"
},
{
"post_id": 102,
"business_id": "1234567891"
}
]
}{
"errors": {
"authentication": "User not authenticated"
}
}{
"errors": {
"authorization": "Operation not allowed"
}
}{
"errors": {
"json": "Resource not found"
}
}Authorizations
Body
application/json
Request body to create a Post
Response
OK
Was this page helpful?