Users
This section contains what all users related actions can be performed using Admin APIs.
Create a User
Creates a new user.
POST https://api.channelize.io/v2/users
Body Params
This table lists all possible parameters body of this API request supports.
Name | Type | Required | Default | Description |
---|---|---|---|---|
id | string | no | auto generated | The unique ID of the user. |
displayName | string | yes | - | The user's name. |
language | string | no | en | Specifies the code of language to translate the text phrases used in User Interface. |
profileImageUrl | string | no | null | The URL of user's profile image. |
metaData | object | no | null | Additional information of the user that you can save like: location, gender etc. |
profileUrl | string | no | null | The unique URL of user's profile. |
createdAt | string | no | $now | The timestamp when the user was created. |
string | no | null | The email address of the user. | |
password | string | no | null | The login password of the user. |
Response
Status Code : 201
{
"id": "1",
"displayName": "Channelize Demo User",
"language": "en",
"profileImageUrl": "https://channelize.io/profile.png",
"metaData": {
"location": "USA"
},
"profileUrl": "https://channelize.io/userprofile",
"isOnline": false,
"visibility": true,
"notification": true,
"lastSeen": "2018-11-15T05:09:22.621Z",
"lastLogin": "2018-11-15T04:59:30.643Z",
"lastActivity": "2018-11-15T04:59:30.668Z",
"createdAt": "2018-07-19T13:56:08.000Z",
"updatedAt": "2018-07-19T13:56:08.000Z",
"email": "demouser99@channelize.io"
}
Search / List Users
Retrieves a list of users in your application. You can filter the list using various parameters.
GET https://api.channelize.io/v2/users
Query Params
The following table lists the parameters this API call supports to get filtered results.
Name | Type | Required | Default | Description |
---|---|---|---|---|
online | boolean | no | null | Restricts the search scope to only retrieve online or offline users. If set to false, offline users are returned. If set to true, online users are returned in the response. |
search | string | no | null | Searches for users whose display name matches the specified value. |
role | string | no | null | Restricts the search scope to only retrieve normal users or bot users. Allowed values are user and bot. |
sort | string | no | displayName ASC | Specifies the sorting criteria for the returned results. Allowed values are displayName ASC and displayName DESC. |
includeDeleted | boolean | no | false | Specify if you want to include the deleted users in the returned response or not. If set to true, the response will include deleted users. If set to false, the response will not include deleted users. |
metaData | string | no | null | Searches for users whose metaData matches the specified value. like : "metaData.location" : "USA" |
limit | double | no | 50 | Specifies the number of results to return. |
skip | double | no | 0 | Specifies the number of results you want to skip from the beginning. |
Response
Status Code : 200
[
{
"id": "1",
"displayName": "Channelize Demo User",
"language": "en",
"profileImageUrl": "https://channelize.io/profile.png",
"profileUrl": "https://channelize.io/userprofile",
"metaData": {
"location": "USA"
},
"isOnline": false,
"visibility": true,
"notification": true,
"lastSeen": "2018-11-15T05:09:22.621Z",
"lastLogin": "2018-11-15T04:59:30.643Z",
"lastActivity": "2018-11-15T04:59:30.668Z",
"createdAt": "2018-07-19T13:56:08.000Z",
"updatedAt": "2018-07-19T13:56:08.000Z",
"email": "demouser99@gmail.com"
}
]
NOTE: This Admin API can also be accessed using the Application API’s request header, i.e by using Public Key. To access this as Application API, first change the setting in your Channelize.io Dashboard from 'App Settings' > 'Security'.
Export User
This API lets you pull out user data and messages from your app, and output the results to JSON formatted files.
GET https://api.channelize.io/v2/users/{id}/export
Path Params
This table lists all possible parameters this API request supports.
Name | Type | Required | Default | Description |
---|---|---|---|---|
userId | string | yes | - | Specifies the unique ID of the user whose data export to perform. |
Response
Status Code : 200
{
"info":
{
"createdAt": "2019-09-19T06:13:12.995Z",
"displayName": "Channelize Demo User",
"email": "demouser99@channelize.io",
"id": "12345",
"isOnline": false,
"language": "English",
"lastActivity": "2019-09-19T06:13:38.655Z",
"lastLogin": "2019-09-19T06:13:19.129Z",
"lastSeen": "2019-09-19T06:13:54.045Z",
"notification": true,
"profileImageUrl": "https://channelize.io/profile.jpg",
"profileUrl": "https://channelize.io/profile/23664",
"metaData": {
"location": "USA"
},
"updatedAt": "2019-09-19T06:13:12.995Z",
"visibility": true
},
"messages": []
}
Delete User
Deletes a user. You will get a “No Record Found” error message if provided user id does not exist in the database.
DELETE https://api.channelize.io/v2/users/{id}/delete
Path Params
This table lists all possible parameters this API call supports.
Name | Type | Required | Default | Description |
---|---|---|---|---|
id | string | yes | - | The unique ID of the target user. |
Response
Status Code : 200
[]