Update a post
curl --request PUT \
--url https://api.partoo.co/v2/posts/{post_id} \
--header 'Content-Type: application/json' \
--header 'x-APIKey: <api-key>' \
--data '
{
"title": "Great post title !",
"summary": "Wonderful post summary !",
"image_url": [
"https://example.com/1.png",
"https://example.com/2.png"
],
"link": {
"use_business_url": true,
"custom_url": "<string>"
},
"schedule_time": "2050-01-01T09:00:00",
"start_at": "2050-01-01T09:00:00",
"end_at": "2050-01-01T09:00:00",
"coupon_code": "PROMO25",
"offer_terms": "These are the conditions"
}
'import requests
url = "https://api.partoo.co/v2/posts/{post_id}"
payload = {
"title": "Great post title !",
"summary": "Wonderful post summary !",
"image_url": ["https://example.com/1.png", "https://example.com/2.png"],
"link": {
"use_business_url": True,
"custom_url": "<string>"
},
"schedule_time": "2050-01-01T09:00:00",
"start_at": "2050-01-01T09:00:00",
"end_at": "2050-01-01T09:00:00",
"coupon_code": "PROMO25",
"offer_terms": "These are the conditions"
}
headers = {
"x-APIKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-APIKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Great post title !',
summary: 'Wonderful post summary !',
image_url: ['https://example.com/1.png', 'https://example.com/2.png'],
link: {use_business_url: true, custom_url: '<string>'},
schedule_time: '2050-01-01T09:00:00',
start_at: '2050-01-01T09:00:00',
end_at: '2050-01-01T09:00:00',
coupon_code: 'PROMO25',
offer_terms: 'These are the conditions'
})
};
fetch('https://api.partoo.co/v2/posts/{post_id}', 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/{post_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Great post title !',
'summary' => 'Wonderful post summary !',
'image_url' => [
'https://example.com/1.png',
'https://example.com/2.png'
],
'link' => [
'use_business_url' => true,
'custom_url' => '<string>'
],
'schedule_time' => '2050-01-01T09:00:00',
'start_at' => '2050-01-01T09:00:00',
'end_at' => '2050-01-01T09:00:00',
'coupon_code' => 'PROMO25',
'offer_terms' => 'These are the conditions'
]),
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/{post_id}"
payload := strings.NewReader("{\n \"title\": \"Great post title !\",\n \"summary\": \"Wonderful post summary !\",\n \"image_url\": [\n \"https://example.com/1.png\",\n \"https://example.com/2.png\"\n ],\n \"link\": {\n \"use_business_url\": true,\n \"custom_url\": \"<string>\"\n },\n \"schedule_time\": \"2050-01-01T09:00:00\",\n \"start_at\": \"2050-01-01T09:00:00\",\n \"end_at\": \"2050-01-01T09:00:00\",\n \"coupon_code\": \"PROMO25\",\n \"offer_terms\": \"These are the conditions\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.partoo.co/v2/posts/{post_id}")
.header("x-APIKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Great post title !\",\n \"summary\": \"Wonderful post summary !\",\n \"image_url\": [\n \"https://example.com/1.png\",\n \"https://example.com/2.png\"\n ],\n \"link\": {\n \"use_business_url\": true,\n \"custom_url\": \"<string>\"\n },\n \"schedule_time\": \"2050-01-01T09:00:00\",\n \"start_at\": \"2050-01-01T09:00:00\",\n \"end_at\": \"2050-01-01T09:00:00\",\n \"coupon_code\": \"PROMO25\",\n \"offer_terms\": \"These are the conditions\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.partoo.co/v2/posts/{post_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-APIKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Great post title !\",\n \"summary\": \"Wonderful post summary !\",\n \"image_url\": [\n \"https://example.com/1.png\",\n \"https://example.com/2.png\"\n ],\n \"link\": {\n \"use_business_url\": true,\n \"custom_url\": \"<string>\"\n },\n \"schedule_time\": \"2050-01-01T09:00:00\",\n \"start_at\": \"2050-01-01T09:00:00\",\n \"end_at\": \"2050-01-01T09:00:00\",\n \"coupon_code\": \"PROMO25\",\n \"offer_terms\": \"These are the conditions\"\n}"
response = http.request(request)
puts response.read_body{
"id": 34,
"business_id": "5409c35a97bbc544d8e26737",
"post_type": "news",
"summary": "Wonderful post summary !",
"schedule_time": "2020-01-01T12:00:00+02:00",
"expiration_time": "2020-01-01T12:00:00+02:00",
"validation_time": "2020-01-01T12:00:00+02:00",
"post_medias": [
{
"media_url": [
"https://example.com/1.png",
"https://example.com/2.png"
]
}
],
"created_at": "2019-08-01T19:15:54.256000+02:00",
"updated_at": "2019-09-01T15:12:35.256000+02:00",
"created_on_partoo": false,
"updated_on_partoo": false,
"business_info": "Rick - HQ - 157 boulevard Macdonald, Paris",
"post_insight": [
{
"name": "facebook__posts",
"click_count": 1512,
"view_count": 2012
}
],
"post_status": [
{
"name": "facebook__posts",
"state": "live",
"link": "www.partoo.co"
}
],
"offer_terms": "These are the conditions",
"offer_code": "PROMO25",
"cta_link": "www.partoo.co",
"cta_type": "book"
}{
"errors": {
"authentication": "User not authenticated"
}
}{
"errors": {
"authorization": "Operation not allowed"
}
}{
"errors": {
"json": "Resource not found"
}
}Posts
Update a post
This endpoint lets you update a post.
When used by a BM or GM user, this endpoint also serves to validate and publish a draft post.
The update will not happen in real time and might take a few minutes
⚠️ Due to Instagram API limitations, this operation has no effect on Instagram posts.
PUT
/
posts
/
{post_id}
Update a post
curl --request PUT \
--url https://api.partoo.co/v2/posts/{post_id} \
--header 'Content-Type: application/json' \
--header 'x-APIKey: <api-key>' \
--data '
{
"title": "Great post title !",
"summary": "Wonderful post summary !",
"image_url": [
"https://example.com/1.png",
"https://example.com/2.png"
],
"link": {
"use_business_url": true,
"custom_url": "<string>"
},
"schedule_time": "2050-01-01T09:00:00",
"start_at": "2050-01-01T09:00:00",
"end_at": "2050-01-01T09:00:00",
"coupon_code": "PROMO25",
"offer_terms": "These are the conditions"
}
'import requests
url = "https://api.partoo.co/v2/posts/{post_id}"
payload = {
"title": "Great post title !",
"summary": "Wonderful post summary !",
"image_url": ["https://example.com/1.png", "https://example.com/2.png"],
"link": {
"use_business_url": True,
"custom_url": "<string>"
},
"schedule_time": "2050-01-01T09:00:00",
"start_at": "2050-01-01T09:00:00",
"end_at": "2050-01-01T09:00:00",
"coupon_code": "PROMO25",
"offer_terms": "These are the conditions"
}
headers = {
"x-APIKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-APIKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Great post title !',
summary: 'Wonderful post summary !',
image_url: ['https://example.com/1.png', 'https://example.com/2.png'],
link: {use_business_url: true, custom_url: '<string>'},
schedule_time: '2050-01-01T09:00:00',
start_at: '2050-01-01T09:00:00',
end_at: '2050-01-01T09:00:00',
coupon_code: 'PROMO25',
offer_terms: 'These are the conditions'
})
};
fetch('https://api.partoo.co/v2/posts/{post_id}', 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/{post_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Great post title !',
'summary' => 'Wonderful post summary !',
'image_url' => [
'https://example.com/1.png',
'https://example.com/2.png'
],
'link' => [
'use_business_url' => true,
'custom_url' => '<string>'
],
'schedule_time' => '2050-01-01T09:00:00',
'start_at' => '2050-01-01T09:00:00',
'end_at' => '2050-01-01T09:00:00',
'coupon_code' => 'PROMO25',
'offer_terms' => 'These are the conditions'
]),
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/{post_id}"
payload := strings.NewReader("{\n \"title\": \"Great post title !\",\n \"summary\": \"Wonderful post summary !\",\n \"image_url\": [\n \"https://example.com/1.png\",\n \"https://example.com/2.png\"\n ],\n \"link\": {\n \"use_business_url\": true,\n \"custom_url\": \"<string>\"\n },\n \"schedule_time\": \"2050-01-01T09:00:00\",\n \"start_at\": \"2050-01-01T09:00:00\",\n \"end_at\": \"2050-01-01T09:00:00\",\n \"coupon_code\": \"PROMO25\",\n \"offer_terms\": \"These are the conditions\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.partoo.co/v2/posts/{post_id}")
.header("x-APIKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Great post title !\",\n \"summary\": \"Wonderful post summary !\",\n \"image_url\": [\n \"https://example.com/1.png\",\n \"https://example.com/2.png\"\n ],\n \"link\": {\n \"use_business_url\": true,\n \"custom_url\": \"<string>\"\n },\n \"schedule_time\": \"2050-01-01T09:00:00\",\n \"start_at\": \"2050-01-01T09:00:00\",\n \"end_at\": \"2050-01-01T09:00:00\",\n \"coupon_code\": \"PROMO25\",\n \"offer_terms\": \"These are the conditions\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.partoo.co/v2/posts/{post_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-APIKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Great post title !\",\n \"summary\": \"Wonderful post summary !\",\n \"image_url\": [\n \"https://example.com/1.png\",\n \"https://example.com/2.png\"\n ],\n \"link\": {\n \"use_business_url\": true,\n \"custom_url\": \"<string>\"\n },\n \"schedule_time\": \"2050-01-01T09:00:00\",\n \"start_at\": \"2050-01-01T09:00:00\",\n \"end_at\": \"2050-01-01T09:00:00\",\n \"coupon_code\": \"PROMO25\",\n \"offer_terms\": \"These are the conditions\"\n}"
response = http.request(request)
puts response.read_body{
"id": 34,
"business_id": "5409c35a97bbc544d8e26737",
"post_type": "news",
"summary": "Wonderful post summary !",
"schedule_time": "2020-01-01T12:00:00+02:00",
"expiration_time": "2020-01-01T12:00:00+02:00",
"validation_time": "2020-01-01T12:00:00+02:00",
"post_medias": [
{
"media_url": [
"https://example.com/1.png",
"https://example.com/2.png"
]
}
],
"created_at": "2019-08-01T19:15:54.256000+02:00",
"updated_at": "2019-09-01T15:12:35.256000+02:00",
"created_on_partoo": false,
"updated_on_partoo": false,
"business_info": "Rick - HQ - 157 boulevard Macdonald, Paris",
"post_insight": [
{
"name": "facebook__posts",
"click_count": 1512,
"view_count": 2012
}
],
"post_status": [
{
"name": "facebook__posts",
"state": "live",
"link": "www.partoo.co"
}
],
"offer_terms": "These are the conditions",
"offer_code": "PROMO25",
"cta_link": "www.partoo.co",
"cta_type": "book"
}{
"errors": {
"authentication": "User not authenticated"
}
}{
"errors": {
"authorization": "Operation not allowed"
}
}{
"errors": {
"json": "Resource not found"
}
}Authorizations
Body
application/json
Request body to update a Post
URLs of the images displayed with the post.
Note:
- Add up to 10 images for multi-image post on Facebook and IG
- Multi-image is not supported by Google, only the first image will be displayed
- Image ratio must be between 4:5 and 16:9 for IG
- All images must be same ratio for IG or they will be crop at the first image ratio by IG
Example:
[
"https://example.com/1.png",
"https://example.com/2.png"
]
Response
OK
Post
Was this page helpful?