How to integrate Rocket.Chat as a ticket service on the Weni Plataform
Updated
by Giovana Borges Feitosa
Rocket.Chat Ticketer
Requirements
- Admin access to Rocket.Chat
- Admin access to Weni Flows
First steps
- Get org access token in Weni Flows
This token is required for the app installed on Rocket.Chat to be able to communicate with your organization on Weni Flows.
In the side menu of the platform go to Settings
and at the end of the page you will have a field informing your Token.

- Get Rocket.Chat User ID and Access Token
- The Rocket.Chat ID is so that Weni Flow can communicate with the installed application.
- In Rocket.Chat go to
My account > Personal access tokens
, check the optionBypass two-factor authentication
and enter a name for the token.

- Connect Rocket.Chat to the Rocket Cloud console
- In Rocket.Chat go to
Administration > Connectivity Services > Cloud Console
- Follow the steps to register a self-managed Rocket.Chat and enter the token provided in the cloud in Rocket.Chat
- After inserting the Token, new options will appear on the Rocket.Chat screen, on that click
Login to Rocket.Chat Cloud
.
Install the Ticket app
- Go in
Administration > Apps > Marketplace
- Search for
WhatsApp Tickets by Weni
and install the App.
Configure the Ticket Service
To perform the configuration, configurations must be made in parallel in the Application and in the Ticket Service in Weni Flows. The process becomes simpler if you have already written down the Tokens that were obtained previously (Weni Flows Token, Rocket Token and User ID), to start the configuration:
- Go to the side menu of the platform at
Integrations
- Inside the module go to
Others Apps
- Next to the option
Add Channel
click on the menu and chooseAdd Ticketing Service
- Choose the Rocket.Chat option
- Configure the fields with the Rocket.Chat User ID and Token
- In the URL field, go to Rocket.Chat on the installed app's details screen and copy the url from the app's API listing:

It must be in the following format:
https://chat.weni.ai/api/apps/public/02c2b89b-f8c4-446c-abe0-b97c5e0d4649
- In the third step of the installation guide which is in the ticket service, there is a
Secret
that will be used to authenticate the configuration request, copy and paste it into the app's configuration page in Rocket.Chat, in the fieldApp Secret
.
Obs: This secret is updated whenever the page is reloaded. Always before clicking connect, make sure the secret matches the one configured in Rocket.Chat
- After entering Secret in application settings, paste the org access token in the field
Weni Authorization Token
and clickSave
in the upper right field. - With the app properly configured, go back to Weni Flows and click
Connect
on the Ticket service configuration screen.
Configure a flow to use the service
- In the flow editor, to open a room in Rocket.Chat use the card
Open a ticket with a human agent
- In the first selector choose the configured Rocket.Chat ticket service.
Obs: The selectors where you have
General
andAssign to
are currently not supported by the Rocket.Chat ticket service
- Leave the body of the card empty, removing the default string
@results
.
Card body must be empty or receive valid JSON with department information and/or custom fields.
With this, it is now possible to open a service for the contact
Assign a department when opening the Ticket
- In the body of the card
Open a ticket with a human agent
add the department name as follows:
{
"department": "departamento_x"
}
Add custom fields on room opening
- In the body of the card
Open a ticket with a human agent
add the custom fields as follows:
{
"customFields": {
"age": @run.contact.fields.age,
"city": @run.contact.fields.city
}
}