Skip to main content
POST
/
comments
Post a reply to a review
curl --request POST \
  --url https://api.partoo.co/v2/comments \
  --header 'Content-Type: application/json' \
  --header 'x-APIKey: <api-key>' \
  --data '
{
  "review_id": 34,
  "content": "Merci ❤️",
  "parent_id": 1234,
  "reply_template_id": 5678,
  "reply_suggestion": {
    "reply_suggestion_id": 91011,
    "reply_suggestion_modified": true
  }
}
'
import requests

url = "https://api.partoo.co/v2/comments"

payload = {
    "review_id": 34,
    "content": "Merci ❤️",
    "parent_id": 1234,
    "reply_template_id": 5678,
    "reply_suggestion": {
        "reply_suggestion_id": 91011,
        "reply_suggestion_modified": True
    }
}
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({
    review_id: 34,
    content: 'Merci ❤️',
    parent_id: 1234,
    reply_template_id: 5678,
    reply_suggestion: {reply_suggestion_id: 91011, reply_suggestion_modified: true}
  })
};

fetch('https://api.partoo.co/v2/comments', 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/comments",
  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([
    'review_id' => 34,
    'content' => 'Merci ❤️',
    'parent_id' => 1234,
    'reply_template_id' => 5678,
    'reply_suggestion' => [
        'reply_suggestion_id' => 91011,
        'reply_suggestion_modified' => true
    ]
  ]),
  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/comments"

	payload := strings.NewReader("{\n  \"review_id\": 34,\n  \"content\": \"Merci ❤️\",\n  \"parent_id\": 1234,\n  \"reply_template_id\": 5678,\n  \"reply_suggestion\": {\n    \"reply_suggestion_id\": 91011,\n    \"reply_suggestion_modified\": true\n  }\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/comments")
  .header("x-APIKey", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"review_id\": 34,\n  \"content\": \"Merci ❤️\",\n  \"parent_id\": 1234,\n  \"reply_template_id\": 5678,\n  \"reply_suggestion\": {\n    \"reply_suggestion_id\": 91011,\n    \"reply_suggestion_modified\": true\n  }\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.partoo.co/v2/comments")

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  \"review_id\": 34,\n  \"content\": \"Merci ❤️\",\n  \"parent_id\": 1234,\n  \"reply_template_id\": 5678,\n  \"reply_suggestion\": {\n    \"reply_suggestion_id\": 91011,\n    \"reply_suggestion_modified\": true\n  }\n}"

response = http.request(request)
puts response.read_body
{
  "id": 82938,
  "partner_id": "accounts/114063712393225091258/locations/74805271119400652054",
  "created": "2019-08-01T19:15:54.256000+02:00",
  "author_name": "Castorche",
  "content": "Merci ❤️",
  "date": "2017-08-01T19:15:54.256000+02:00",
  "update_date": "2017-08-01T19:15:54.256000+02:00",
  "can_edit": true,
  "review_id": 34,
  "parent_id": 123,
  "user_id": "123456789abcdef2f60c42ff",
  "is_reply_suggestion": true,
  "replies": "<array>"
}
{
  "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.

Body

application/json

Request body to post a reply

review_id
number
required

ID of the review you want to reply

Example:

34

content
string<text>
required

Content of your reply

Example:

"Merci ❤️"

parent_id
number

The id of the parent comment you want to reply

Works only for Facebook comments, since it's possible to reply to a comment (depth max is 2). Google and TripAdvisor don't accept this behaviour.

Example:

1234

reply_template_id
number

ID of the reply template to use

Example:

5678

reply_suggestion
object

Suggestion details for the reply, check how to retrieve values in the Fetch AI reply suggestion for reviews section.

Response

OK

Reply to a review

id
integer

Comment id

Example:

82938

partner_id
string

Review id on publisher

Example:

"accounts/114063712393225091258/locations/74805271119400652054"

created
string<datetime>

Creation date on Partoo

Example:

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

author_name
string

The author name of the review.

Note: Replies don't have an author.

Example:

"Castorche"

content
string

Reply content

Example:

"Merci ❤️"

date
string<datetime>

Comment date

Example:

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

update_date
string<datetime>

Comment update date. Only specified if the comment was updated

Example:

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

can_edit
boolean

If the current user can or cannot edit a reply

Note: This applies on Facebook replies only. A reply left by an external user on Facebook cannot be edited.

Example:

true

review_id
integer

Review id

Example:

34

parent_id
integer

id of the parent comment. Is only specified if the comment is a reply to another comment

Note: This applies on Facebook replies only.

user_id
string

User id of the comment author

Example:

"123456789abcdef2f60c42ff"

is_reply_suggestion
boolean

If AI reply suggestion was used to generate this comment

replies
array

List of replies to this comment