Skip to main content
GET
/
conversations
List conversations
curl --request GET \
  --url https://api.partoo.co/v2/conversations \
  --header 'x-APIKey: <api-key>'
import requests

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

headers = {"x-APIKey": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-APIKey': '<api-key>'}};

fetch('https://api.partoo.co/v2/conversations', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)

func main() {

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

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-APIKey", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.partoo.co/v2/conversations")
.header("x-APIKey", "<api-key>")
.asString();
require 'uri'
require 'net/http'

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

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-APIKey"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "conversations": [
    {
      "id": 123,
      "consumer_img": "https://www.example.com/profile-picture.jpg",
      "consumer_name": "John Doe",
      "consumer_phone_number": "+33612345678",
      "consumer_email": "john.doe@example.com",
      "last_message": {
        "id": 123,
        "conversation_id": 123,
        "date": "2023-01-31 16:22:17.327878+00:00",
        "sender_label": "Jane Doe",
        "is_deleted": false,
        "is_automated": false,
        "content": "<string>",
        "user_id": "<string>",
        "custom_channel": {
          "external_message_id": "<string>"
        }
      },
      "is_read": true,
      "created_at": "2023-01-31 16:22:17.327878+00:00",
      "has_one_user_message": true,
      "business": {
        "id": "<string>",
        "name": "<string>",
        "city": "<string>",
        "zipcode": "<string>",
        "country": "<string>",
        "formatted_address": "<string>"
      },
      "messaging_partner": "Facebook",
      "issues": [
        "facebook_no_page_linked"
      ],
      "first_message_date": "<string>",
      "is_expired": false,
      "is_solved": false,
      "is_automated": false,
      "assigned_user_id": "62d80fae74e8b11d700302b8",
      "custom_channel": {
        "id": "<string>",
        "name": "<string>",
        "icon": "<string>",
        "is_readonly": true,
        "external_conversation_id": "<string>"
      }
    }
  ],
  "count": 1,
  "next_cursor": "<string>"
}
{
"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.

Query Parameters

per_page
integer
default:30

Number of items to return per page.

Required range: 1 <= x <= 100
cursor
string

The cursor identifiying the page of data to fetch. If no cursor is provided, the query will return the first page of data. A cursor for the next page of data is provided in the response of this request.

business__in
string[]

Filter by business ids. Use a comma-separated list to provide multiple ids.

Example:

"a1c9f37b4deca92f83b61d02,9f4e2a8c0d73b154e621bc97,c73b15e9fa42d60b3a8c21ef"

Response

OK

Response object

conversations
Conversation · object[]

The list of conversations, paginated.

count
integer

Total number of results available for the filters and dimensions requested.

Example:

1

next_cursor
string | null

The cursor to use in order to retrieve the next page of data. When all data have been fetched, the value is null.