User

This section contains user Qiscus Chat SDK behavior. You can do login or register user with meta data, update user profile with metadata, get users who have unread count, and get all users data.

You need to register the user to Qiscus Server, or if you already have Qiscus Account, you can login or update user properties except the userId.

Login or Register

You can use this endpoint to create new user if it does not exist yet, or login in Qiscus Server if does exist, or update user's data, such as password, avatar, and, extras. You also can send an extra data in user's data by using extras payload, such as you want to add user type, then you can put key as user_type and put your desired value.

Request:

HTTP
Copy

Header:

Bash
Copy

Endpoint:

[POST] /login_or_register

Params:

KeyTypeDescription
user_id (required)stringUser Id in Qiscus Server, cannot contains symbol, except .-_@
username (required)
stringName of user
password (optional)stringUser password in Qiscus Server, if password is provided and user exists, the user's password will be updated
avatar_url (optional)
stringUser avatar url
extras (optional)jsonYou can define meta data here using valid JSON

Example request:

Bash
Copy

Response:

JSON
Copy

Note : password is optional, it will generate random string on the backend if you don't pass it during User creation through this API. However, please note for those users already created you can not use this API login_or_register without passing password value

Get User Profile

To get user's profile data.

Request:

HTTP
Copy

Header:

Bash
Copy

Endpoint:

[GET] /user_profile

Params:

KeyTypeDescription
user_id (required)stringUser id in Qiscus Server, cannot contains symbol, except .-_@

Example request:

Bash
Copy

Response:

JSON
Copy

Reset User Token

To reset user's token.

Request:

HTTP
Copy

Headers:

Bash
Copy

Endpoint:

[POST] /reset_user_token

Params:

KeyTypeDescription
user_id (required)StringUser id in Qiscus Server, cannot contains symbol, except .-_@

Example request:

Bash
Copy

Response:

JSON
Copy

Get User List

To get list of users.

Request:

HTTP
Copy

Headers:

Bash
Copy

Endpoint:

[GET]/get_user_list

Params:

Key (Optional)TypeDescription
pageintdefault: 1
limitintdefault: 20, max: 100, if the limit more than 100 then return 20

Example request:

Bash
Copy

Response:

JSON
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard