API Access & Zapier Integration

Overview

Modr8 offers bot owners the ability to access some of the data generated by the platform and your chat through its API. We have had cases where being able to access reputation data for users has allowed whole ecosystems to be built out including using reputation points to purchase swag and merchandise from stores. We also offer the ability for you to integrate your telegram mod bot with Zapier, a no/low code automation platform that will allow you to trigger messages with custom content into your chat.

Gaining Access To Modr8 API

Bot owners are able to access the Modr8 API credentials. These can then be passed on to a developer to authenticate with Modr8 API gateway and use the relevant methods for extracting data.

  1. Login to the Modr8 platform

  2. Select "Manage" on your bot profile

  3. Select the "Bot Menu" below your bot profile image

  4. Select "API" from the drop down menu

  5. A token will be displayed in the grey input box, copy this to use for accessing the API.

  6. Review instructions displayed on the API Information card to see the web address required to access the platform API.

You are able to renew the token by clicking the red button labelled "Renew Token"

API Methods & Usage

The following table lists the existing API methods available and a description for their usage. We will be adding new methods as requested.

Topic
Method
End Point
Description

Chat List

GET

chats/

List of registered chats.

Chat Users

GET

chats/{{chat_id}}/users

List of tracked users in chat.

Chat User

GET

chats/{{chat_id}}/users/{{user_id}}

Specific tracked user in a chat.

All Reputation

GET

chats/{{chat_id}}/reputation

Reputation points by user.

Single User Reputation

GET

chats/{{chat_id}}/reputation/{{user_id}}

Retrieve reputation for a single user.

Add User Reputation

PUT

chats/{{chat_id}}/reputation/{{user_id}}/add/{{amount}}

Add reputation points to a user.

Remove User Reputation

PUT

chats/{{chat_id}}/reputation/{{user_id}}/remove/{{amount}}

Remove reputation points from a user.

Integrating Modr8 to Zapier

Zapier is a web based tool that lets you connect web based apps and automate tasks between them. Modr8 has a custom Zapier connector which allows you to send messages from zapier flows through your Modr8 bot.

Zapier offers 1000's of different apps that can trigger your Modr8 bot to issue a message. You might want to hook up a notification of e-mails hitting your inbox or tickets being created in your CRM system. It's all possible using Zapier and the Modr8 bot connector.

Getting Your Integration Setup

The zapier connector is invite only and utilises the API key from Modr8 platform to authenticate your bot to the platform. To get connected complete the following steps.

  1. Accept the invite by clicking the "Accept Invite & Build A Zap" button.

  2. Click "+ Create" at the top right of the screen and click "Zaps" to load the Zapier canvas

  3. Select the "+" to load the Zap search and then type "Modr8" in the search bar

  4. Select the Modr8 app listed, it will show an Invite Only flag

  5. Select the "Action event" which is what action you wish the bot to take when it receives an input. For now select "Send Message"

  6. Select "Account" and create a new connection, which will load a pop up screen.

  7. Retrieve your API token for Modr8 using the instructions listed here you will be looking for the API key.

  8. Paste the API key into the pop-up input box and select "Yes connect to Modr8", after a few seconds the connection will process and save.

  9. Click "Continue" button at the bottom of the Send Message form.

  10. Specify a chat identifier where you wish the message to be sent to. The ID for your chat can be found by typing /debug in your chat and seeing the ID field under "Chat Details" it usually starts with "-100"

  11. Add the message text you wish to send, which could be injected from the node which triggers your zap to run.

  12. Select "Test Step" and if everything goes well you can then continue building your zap!

Last updated

Was this helpful?