Note: These APIs are still in alpha, and there might be changes in the implementation in future.
Client APIs available for the API channel will help you build customer-facing interfaces for Chatwoot.
These APIs are useful for cases similar to the ones described below.
- Use a custom chat interface instead of the Chatwoot chat widget
- Build conversational interfaces into your mobile apps
- Add Chatwoot to other platforms for which Chatwoot doesn't have an official SDK
You can create and retrieve customer data objects using the
inbox_identifier for the API channel can be obtained by running the following command in your rails console.
customer_identifier or the
source_id can be obtained when creating the customer using the create API.
You will need to store this identifier on your client-side to make further requests on behalf of the customer.
This can be done in cookies, local storage etc.
The Available Client APIs are documented here. Some of the things you can do via the APIs are
- Create, View and Update Contact
- Create and List Conversations
- Create, List and Update Messages
The Client APIs also support HMAC Authentication. The HMAC token for the Channel can be obtained via running the following on your rails console.
To receive the real-time updates from the agent dashboard, You can connect to the Chatwoot WebSockets. Chatwoot WebSockets connecting can be made at the following URL
You will start receiving the events directed towards your customer object after subscribing using the customer
pubsub_token is provided during the customer create API call.
Find the full list of events supported by the websockets here.
You can find an example chat interface build over the Client APIs over here