Chatwee HTTP API

Chatwee HTTP API is a method for integrating your website with the Chatwee app.

Introduction

Chatwee API utilizes the HTTP protocol. Every resource can be accessed using the GET method and every parameter needed for a specific call should be a URL-encoded value passed on via the query string.

All Chatwee API responses are sent as UTF-8 encoded messages. If a call ends up being successful, the HTTP 200 OK code is returned, along with the matching response. Whenever a request cannot be properly processed, an error object is being returned. All error responses have a common JSON format including two fields: errorCode and errorMessage. See the example below:


{"errorCode": "BAD_REQUEST","errorMessage": "Invalid chat id"}
	

/sso-user

/sso-user API is a set of methods allowing you to use the Single Sign-on mechanism.

GET /sso-user/register

Creates an SSO user in the Chatwee database. This method should be called whenever a new user is created in the host service. The method returns the newly created user ID which is required for the SSO login method and for targeting the user that we want to start a conversation with.


http://chatwee-api.com/v2/sso-user/register
	

GET http://chatwee-api.com/v2/sso-user/register?chatId=65c493789da1fbc017000029&clientKey=447f191e810c19729de860ea&login=TestUser&isAdmin=0
	

"582b8fe76b0c2d22587336f4"
	
Name Description Type Mandatory Remarks
chatId unique chat ID string yes available in 'INTEGRATION' section of the Chatwee Dashboard
clientKey client secret string yes available in 'INTEGRATION' section of the Chatwee Dashboard
login user login string yes -
isAdmin if user has admin role (0,1) no -
avatar user avatar string no an absolute URL of the user's avatar image

GET /sso-user/login

Logs in the user identified by his user ID. This method should be called whenever a user logs in to the host service. This method returns the ID of the newly created session.


http://chatwee-api.com/v2/sso-user/login
	

GET http://chatwee-api.com/v2/sso-user/login?chatId=57c493789da1fbc017000029&clientKey=507f191e810c19729de860ea&userId=582b8fe76b0c2d22587336f4
	

"3d14222e14addf548a12ffad"
	
Name Description Type Mandatory Remarks
chatId unique chat ID string yes available in 'INTEGRATION' section of the Chatwee Dashboard
clientKey client secret string yes available in 'INTEGRATION' section of the Chatwee Dashboard
userId user ID string yes obtained with /sso-user/register method
userIp user IP address string no is necessary if ban feature needs to be used against SSO users

GET /sso-user/logout

Logs out the user identified by his user ID.


http://chatwee-api.com/v2/sso-user/logout
	

GET http://chatwee-api.com/v2/sso-user/logout?chatId=57c493789da1fbc017000029&clientKey=507f191e810c19729de860ea&userId=582b8fe76b0c2d22587336f4
	

true
	
Name Description Type Mandatory Remarks
chatId unique chat ID string yes available in 'INTEGRATION' section of the Chatwee Dashboard
clientKey client secret string yes available in 'INTEGRATION' section of the Chatwee Dashboard
userId user ID string yes obtained with /sso-user/register method

GET /sso-user/remove-session

Terminates the backend session identified by the particular session ID.


http://chatwee-api.com/v2/sso-user/remove-session
	

GET http://chatwee-api.com/v2/sso-user/remove-session?chatId=57c493789da1fbc017000029&clientKey=507f191e810c19729de860ea&sessionId=3d14222e14addf548a12ffad
	

true
	
Name Description Type Mandatory Remarks
chatId unique chat ID string yes available in 'INTEGRATION' section of the Chatwee Dashboard
clientKey client secret string yes available in 'INTEGRATION' section of the Chatwee Dashboard
sessionId session ID string yes obtained with /sso-user/login method

GET /sso-user/edit

Edits an SSO user in the Chatwee database. Allows for modifying the details of an existing SSO user.


http://chatwee-api.com/v2/sso-user/edit
	

GET http://chatwee-api.com/v2/sso-user/edit?chatId=57c493789da1fbc017000029&clientKey=507f191e810c19729de860ea&userId=582b8fe76b0c2d22587336f4&login=NewLogin&isAdmin=1
	

true
	
Name Description Type Mandatory Remarks
chatId unique chat ID string yes available in 'INTEGRATION' section of the Chatwee Dashboard
clientKey client secret string yes available in 'INTEGRATION' section of the Chatwee Dashboard
userId user ID string yes obtained with /sso-user/register method
login user login string yes -
isAdmin if user has admin role (0,1) no -
avatar user avatar string no an absolute URL of the user's avatar image

GET /sso-user/remove

Removes an SSO user from the Chatwee database.


http://chatwee-api.com/v2/sso-user/remove
	

GET http://chatwee-api.com/v2/sso-user/remove?chatId=57c493789da1fbc017000029&clientKey=507f191e810c19729de860ea&userId=582b8fe76b0c2d22587336f4
	

true
	
Name Description Type Mandatory Remarks
chatId unique chat ID string yes available in 'INTEGRATION' section of the Chatwee Dashboard
clientKey client secret string yes available in 'INTEGRATION' section of the Chatwee Dashboard
userId user ID string yes obtained with /sso-user/register method