Skip to main content
POST
/
conversations
/
{conversation_id}
Update conversation
curl --request POST \
  --url https://api.partoo.co/v2/conversations/{conversation_id} \
  --header 'Content-Type: application/json' \
  --header 'x-APIKey: <api-key>' \
  --data '
{
  "is_read": true
}
'
import requests

url = "https://api.partoo.co/v2/conversations/{conversation_id}"

payload = { "is_read": 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({is_read: true})
};

fetch('https://api.partoo.co/v2/conversations/{conversation_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/conversations/{conversation_id}",
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([
'is_read' => 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/conversations/{conversation_id}"

payload := strings.NewReader("{\n \"is_read\": true\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/conversations/{conversation_id}")
.header("x-APIKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"is_read\": true\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.partoo.co/v2/conversations/{conversation_id}")

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 \"is_read\": true\n}"

response = http.request(request)
puts response.read_body
{
  "status": "success"
}
{
"errors": {
"authentication": "User not authenticated"
}
}
{
"errors": {
"authorization": "Operation not allowed"
}
}

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

conversation_id
integer
required

The id of the conversation to update

Body

application/json

Request body to update a Post

is_read
boolean

Whether the last message received was read.
This property is scoped to the user who performs the request.
Multiple users can have a different is_read status for the same conversation.

Response

OK

status
enum<string>
Available options:
success