Skip to main content

Get a Thread

This endpoint retrieves all messages in a thread.

info

This operation requires authentication.

HTTP Request

GET /api/v2/pm/

Parameters

NameInTypeRequiredDescription
threadqueryinteger(one between thread or user is required)The id of the thread
userqueryinteger(one between thread or user is required)The id of the user
before_messagequeryintegerfalseReturn all messages before this id of the message (excluded before_message)
from_messagequeryintegerfalseReturn all messages from this id of the message (included from_message)
limitqueryintegerfalseNumber of results to return per page
offsetqueryintegerfalseThe initial index from which to return the results

Example Request


const headers = {
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/pm/?thread={id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

Responses

StatusMeaningDescriptionSchema
200OKResponse status codeInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» countintegerfalsenoneTotal results count
» nextstring(uri)¦nullfalsenoneNext page url
» previousstring(uri)¦nullfalsenonePrevious page url
» resultslist(Private Message Thread)falsenoneList of results

Example responses

{
"count": "integer",
"next": "string(uri)",
"previous": "string(uri)",
"results": [
{
"id": "integer",
"message": "string",
"sender": {User},
"receiver": {User},
"created_at": "string",
"status": "string",
"thread_id": "integer"
},
{
"id": "integer",
"message": "string",
"sender": {User},
"receiver": {User},
"created_at": "string",
"status": "string",
"thread_id": "integer"
}
]
}