Conversations
This section contains what all conversations related actions can be performed using Admin APIs.
Get All Conversations
Retrieves all conversations of a target user.
GET https://api.channelize.io/v2/conversations/
Query Params
The following table lists the parameters this API call supports to get filtered results.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
ids | string | no | null | Search the conversations with conversation IDs separated by commas. |
type | string | no | null | Search the conversations with type. Allowed values are private, public. By default all the conversations are retrived. |
customTypes | string | no | null | Search the conversations with custom types separated by commas. |
search | string | no | null | Search the conversations of which names matches with the specified value. |
isGroup | boolean | no | null | Restricts the search scope to only retrieve private 1-to-1 or group conversations. Allowed values are true, false. By default all the conversations are retrived. |
membersIncluded | string | no | null | Searches for conversations with the specified members included in. The string should be specified with multiple user IDs separated by commas (for example: user_id_1, user_id_2). |
membersExactly | string | no | null | Searches for conversations with the specified members exactly in. The string should be specified with multiple user IDs separated by commas (for example: user_id_1, user_id_2) |
includeDeleted | boolean | no | false | Determines whether to include deleted conversation in response. |
includeOnlyActive | string | no | false | Restricts the search scope to retrieve only conversations in which the user is active. |
sort | string | no | updatedAt DESC | Specifies the sorting criteria for the returned results. Allowed values are updatedAt ASC and updatedAt DESC. |
include | string | no | null | Specifies extra fields if you want extra information to be appended with the conversation objects. Allowed values are members. |
limit | int | no | 25 | Specifies the number of results to return. |
skip | int | no | 0 | Specifies the number of results you want to skip from the beginning. (Useful in Pagination) |
Request Example
https://api.channelize.io/v2/conversations?includeDeleted=false&limit=10
Response
Status Code: 201
[
{
"id": "1021",
"title": "Test Group",
"memberCount": 3,
"isGroup": true,
"ownerId": "18646",
"createdAt": "2017-08-24T12:05:06.000Z",
"type": "private",
"customType" : "messaging",
"metaData": [],
"lastReadAt": {
"18646": "2020-01-29T06:48:53.700Z",
"18664": "2020-01-29T07:12:41.613Z",
"18714": "2020-01-29T07:12:41.613Z"
},
"members": [
{
"id": "89c7e350-4265-11ea-9c07-831a487bf6af",
"userId": "18646",
"isAdmin": true,
"user": {
"id": "18646",
"displayName": "alex de bougex",
"profileImageUrl": "https://sample-file-url/media/ff29_078f.jpg",
"metaData": {
"secondaryField": null
},
"profileUrl": "http://devaddons1.socialengineaddons.com/mobiledemodevelopment/profile/alx2bgx",
"isOnline": false,
"notification": true,
"lastSeen": "2020-01-10T13:44:36.000Z"
}
},
{
"id": "89c7e351-4265-11ea-9c07-831a487bf6af",
"userId": "18664",
"isAdmin": false,
"user": {
"id": "18664",
"displayName": "antonis chatzipetrou",
"profileImageUrl": "http://sample-file-url/media/fff4_0edb.jpg",
"metaData": {
"secondaryField": null
},
"profileUrl": "http://devaddons1.socialengineaddons.com/mobiledemodevelopment/profile/AntonisChatzipetrou",
"isOnline": false,
"notification": true,
"lastSeen": "2020-01-10T13:44:36.000Z"
}
},
{
"id": "89c7e352-4265-11ea-9c07-831a487bf6af",
"userId": "18714",
"isAdmin": false,
"user": {
"id": "18714",
"displayName": "alle cavallaro",
"profileImageUrl": "http://sample-file-url/mediea/10263_dd51.jpg",
"metaData": {
"secondaryField": null
},
"profileUrl": "http://devaddons1.socialengineaddons.com/mobiledemodevelopment/profile/AlleCavallaro",
"isOnline": false,
"notification": true,
"lastSeen": "2020-01-10T13:44:36.000Z"
}
}
]
}
]