GET
/api/public/users/:user_id/conversations/Get user conversations
You can return a list of all conversations with a specific user.
| Attributes | Type | Required | Description |
|---|---|---|---|
| user_id | string | yes | A unique identifier for the user which is given by User.com automatically. |
Request
- CURL
- JavaScript
- PHP
- Python
curl -X GET -H "Authorization: Token <your_64_char_api_key>"
-H "Accept: */*; version=2"
-H "Accept: */*; version=2" "https://<your_app_subdomain>.user.com/api/public/users/:user_id/conversations/"
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://<your_app_subdomain>.user.com/api/public/users/:user_id/conversations/");
xhr.setRequestHeader("authorization", "Token <your_64_char_api_key>");
xhr.setRequestHeader("accept", "*/*; version=2");
xhr.send(data);
<?php
$request = new HttpRequest();
$request->setUrl('https://<your_app_subdomain>.user.com/api/public/users/:user_id/conversations/');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'authorization' => 'Token <your_64_char_api_key>'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
import http.client
conn = http.client.HTTPSConnection("/<your_app_subdomain>.user.com")
headers = { 'authorization': "Token <your_64_char_api_key>", "Accept": "*/*; version=2" }
conn.request("GET", "/api/public/users/:user_id/conversations/", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))