
Channelize.io Chat API User-Authentication Methods ---- 2 min read
Channelize.io Chat-Platform-as-a-Service adds feature-rich chat & calling capabilities to apps, which can serve important use-cases for many businesses. Our platform is easy to integrate with our Chat SDKs & API.
User Authentication in API ensures that Channelize.io powered Chat is secure. All our Application API calls are tied up with authentication via tokens passed in the Header.
By default, Channelize.io provides two user-authentication methods. In this post, we’ll cover these methods, the use-cases they’ll fit and steps to implement them.
- Authentication with User ID
- Authentication with Email and Password
Table of Contents
Authentication with User ID
If you’re integrating Channelize.io powered real-time messaging into an Application that avoids saving personal information of users (like Email ID), then this is for you.
This authentication method allows you to securely authenticate users using their User ID and Token.
Who is it for?
- GDPR and HIPAA compliant applications that don’t save or share users’ personal information like Email ID.
- Applications that have their own authentication process, and can do a token-based Single Sign-On (SSO) with Channelize.io API.
- Applications in which email and password are not mandatory in their authentication process.
How to Implement it?
(visit Developer Documentation for details)
Step 1: Make a Login API request
POST https://api.channelize.io/v2/users/login
This request needs below parameters:
- authenticationType – The type of user-authentication request you’re making. Set this to ‘0’ for User-Authentication with User ID.
- userId – The unique ID of the user to authenticate.
- pmClientServerToken – This is a login token that needs to be generated inside your application, saved inside it and deleted post user login.
Step 2: Create a Login token Callback URL in your application. This should be added in the Channelize.io Dashboard under App Settings > Security. This callback URL is invoked by Channelize.io login API to verify the login token which you have created in the above step.
Find below the request/response for Login token Callback URL:
Request
POST https://your-api-url
body:
{
“token” : “token”,
“userId” : “userId”
}
Response
Output JSON expected from the callback:
Send 200 status code and the below body in JSON response.
body:
{
‘token’: token
}
Step 3: In response to the Login API request, an Access Token will be received. Save it in your database or cookies and use it in the Channelize.io Platform APIs header and the JS SDK or Pre-built Web UI.
Authentication with Email and Password
Authentication with Email and Password is another option to authenticate users in Channelize.io
Who is it for?
- Standalone Chat Applications built with Channelize.io.
- Applications which do not have their own authentication process, and want to use Channelize.io API for primary user authentication as well.
How to Implement it?
(visit Developer Documentation for details)
Step 1: Make a Login API request
POST https://api.channelize.io/v2/users/login
This request needs below parameters:
- authenticationType – The type of user-authentication request you’re making. Set this to ‘1’ for User-Authentication with Email and Password.
- email – The email address of the user to authenticate.
- password – Password of the user to authenticate.
Step 2: In response to the Login API request, an Access Token will be received. Save it in your database or cookies and use it in the Channelize.io Platform APIs header and the JS SDK or Pre-built Web UI.
That’s all!
We hope that this quick tutorial has helped you get a good overview of Channelize.io API User Authentication methods. If you have any further questions, we are happy to help. Please contact our team on info@channelize.io.
No Comments