From this article you will learn how to generate a token for ManyChat API and where to get parameters.
How to generate and authorize your token
To use ManyChat API, you need to generate a token. Navigate to Settings -> API and click Generate your Token button.
Please note: Refreshing and Deleting your token will disable all connected API methods!
After successful token generation you can use our Swagger to experiment with API. It is available here.
To add your token to Swagger, click 'Authorize' button here:
To authorize your token type Bearer <your token> and click 'Authorize':
You also can Refresh or Delete your token in API settings tab.
Where can I get parameters (like tag ID)?
- Subscriber ID -- in user card in Audience;
- Flow_ns -- grab it from your Flow URL;
- Tag ID, Custom User Field ID -- use /fb/page/getTags API method to get list of all Tag IDs and /fb/page/getCustomFields for CUF IDs.
How to work with /fb/subscriber/setCustomField API method
Depending on the type of Custom User Field, you need to use one of the following types of data for "field_value":
- Text -- ex. "text"
- Number -- ex. 123
- Boolean -- ex. "true"or "false"
- Date -- ex. “2018-07-18”
- Date and time -- ex. “2018-07-02T00:00:00+00:00"
How to work with /fb/subscriber/findByCustomField API method
You can search for a list of users who have a specific value in a specific Custom User Field.
- This API method only works with Text and Number types of Custom User Fields.
- Results are sorted by last Custom User Field value update for a specific user.
- List is limited by 100 elements.
Is there any limit to a number of API calls?
There is only a RPS limit for POST methods (per page):
- /fb/sending/sendFlow, /fb/sending/sendContent - 25 RPS;
- /fb/subscriber/addTag, /fb/subscriber/removeTag, /fb/subscriber/setCustomField - 10 RPS.
What is API Key?
It is a code used to identify the user, developer, or calling program for a website. ManyChat provides API Key (PRO-feature) to use with the Account Public API. Public API Key can be found in Settings ⇒ API.
There is also a Profile Public API that's used for connection to non-bot-specific things like Templates. It requires a different key: Profile Scoped Public API that can be found here: https://manychat.com/profile/dashboard#settings.