Custom Authentication
Custom Authentication is an add-on to help you connect & and sync your users with chat users on CX Genie


After subscribing to this feature, you can find it in Workspace Settings -> Workspace Information -> Enable required login for chat user. There will be some fields that you need to know:
Authentication URL: This is the endpoint we will call to your server to retrieve user information from there to create a chat user on CX Genie side.
Select identity method: The main field to identify whether that chat user already exists in our system. For example, if you currently select the phone number, after retrieving the user information from your side, CX Genie will check if this phone number has a corresponding chat user. If it does, CX Genie will update the info; if not, we will create a new one.
Header token: The token to be included in the request when our server calls your server.
To use this feature, when embedding the chat or installing the package on mobile, you will need to pass in the user token. Example when embedding bubble chat:
<script src="https..://widget.cxgenie.ai/widget.js" data-aid="227b289e-bb0b-49cc-a9c8-fd9bcafddf18" data-token="%USER_TOKEN%" data-lang="en"></script>
Example: when using URL: http://www.testing.com
Header token: HEADER_TOKEN
User Token: USER_TOKEN
CX Genie will request:
curl --request POST \
--url https://testing.com/ \
--header 'Authorization: HEADER_TOKEN Bearer' \
--header 'Content-Type: application/json' \
--data '{
"access_token": "USER_TOKEN"
}'
Expected response from your server:
{
"status": true,
"message": "Successfully!",
"data": {
"name": "Sample User",
"phone_number": "090XXXXXXX",
"country_code": "+84",
"email": "[email protected]",
"avatar": "https://...",
"label": "Your custom label for chat user"
}
}
Last updated