Skip to main content
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",
  "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"
}
{
  "errors": {
    "authentication": "User not authenticated"
  }
}
{
  "errors": {
    "authorization": "Operation not allowed"
  }
}
{
  "errors": {
    "json": "Resource not found"
  }
}

Authorizations

x-APIKey
string
header
required

The authentication system on Partoo API is using API Key that should be put in the header of the request (the name of the header is x-APIKey). An api_key is linked to a user. This user's role will give you different access level to the API features.

Path Parameters

post_id
number
required

Post id

Body

application/json

Request body to update a Post

title
string

Title of the post.

Example:

"Great post title !"

summary
string

Main text content of the post.

Example:

"Wonderful post summary !"

image_url

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"
]
cta_type
enum<string>

The type of the post to be created. Some type mig.

Available options:
book,
order,
shop,
learn_more,
sign_up,
call,
no_cta

Link displayed in the post to redirect the client clicking on it. Use can only have one of the following parameters ('use_business_url' or 'custom_url').

schedule_time
string

Date and time of when the post will be diffused corresponding platforms. It needs to be at least 2 hours after the time of the request. The timezone used is UTC.

Example:

"2050-01-01T09:00:00"

start_at
string

For either event or offer post type. Defined when it start. Timezone is defined by the business timezone.

Example:

"2050-01-01T09:00:00"

end_at
string

For either event or offer post type. Defined when it end. Timezone is defined by the business timezone.

Example:

"2050-01-01T09:00:00"

coupon_code
string

Offer code that is usable in store or online

Example:

"PROMO25"

offer_terms
string

Terms and conditions of the offer

Example:

"These are the conditions"

Response

OK

Post

id
integer

The Post id

Example:

34

business_id
string

Business id

Example:

"5409c35a97bbc544d8e26737"

post_type
enum<string>

The type of the post to be created. Event and Offer are not yet available for Facebook.

Available options:
news,
event,
offer,
covid
summary
string

Main text content of the post.

Example:

"Wonderful post summary !"

schedule_time
string

Date when the Post will be published. No scheduled start time means that the Post will be published immediately.

Example:

"2020-01-01T12:00:00+02:00"

expiration_time
string

If this post is a draft, this indicates the date when it will be expired (= date after which the BM/GM user will no longer be able to validate and publish).

Example:

"2020-01-01T12:00:00+02:00"

validation_time
string

Date when the Draft post has been validated by the BM or GM user If the post doesn't also have a schedule time, this date coincides with the publishing date

Example:

"2020-01-01T12:00:00+02:00"

post_medias
object[]

The photo that will be on the Post

created_at
string<datetime>

Creation date on Partoo

Example:

"2019-08-01T19:15:54.256000+02:00"

updated_at
string<datetime>

Last update date (either on Partoo or on Partner platform)

Example:

"2019-09-01T15:12:35.256000+02:00"

created_on_partoo
boolean

Indicates whether or not the post was created using Partoo App/API

Example:

false

updated_on_partoo
boolean

Indicates whether or not the post was updated using Partoo App/API

Example:

false

business_info
string

name and address of the business that the post is related to.

Example:

"Rick - HQ - 157 boulevard Macdonald, Paris"

post_insight
object[]

Statistics related to the posts on the different platforms. ⚠️ Due to a Google deprecation, on 20/02/2023, Google views and counts won't be available anymore. Old insights will still be sent. Facebook ones will still be available.

post_status
object[]

Status related to the posts on the different platforms.

offer_terms
string

Terms and conditions of the offer

Example:

"These are the conditions"

offer_code
string

Offer code that is usable in store or online

Example:

"PROMO25"

Link displayed in the post to redirect the client clicking on it.

Example:

"www.partoo.co"

cta_type
enum<string>

The type of the post to be created. Some type mig.

Available options:
book,
order,
shop,
learn_more,
sign_up,
call,
no_cta