Welcome to the the Meya API reference!
The Meya API provides external access to bot resources and services, making the platform open and extensible. The API uses REST when applicable for resources such as /users
and /db
and uses custom service endpoints such as /receive
and /broadcast
.
All API access is over HTTPS, and accessed from the https://api.meya.ai
root. All data is sent and received as JSON. All endpoints require authentication using a token accessed from the Meya admin site.
The Meya API also provides a set of events to which you can subscribe that will notify a URL of your choosing via Webhook.
Trying the API
All of the cURL and Python code examples have been tested to work as is. You can use the "Try it" button to test each endpoint and inpect the response and headers. This is backed by the test API bot with the api key a6xE5yLe0RHPYbiHqR3OKDmRgsZ76RY3
.
We have a list of endpoints and features on the left hand side which we will be adding to as we expand our API over time to provide comprehensive access.
Access your bot via API
- Create a Meya bot (or use an existing bot)
- Add an "API & Webhook" integration
- Note your API key (keep it private)
- Optionally set your Webhook URL to subscribe to events.
Hello, world!
curl -H "Content-Type: application/json" \
-X POST \
-d '{"text": "hi", "user_id": "1234567890"}' \
-u a6xE5yLe0RHPYbiHqR3OKDmRgsZ76RY3: \
https://api.meya.ai/receive
import requests
from requests.auth import HTTPBasicAuth
api_key = "a6xE5yLe0RHPYbiHqR3OKDmRgsZ76RY3"
url = "https://api.meya.ai/receive"
data = {"text": "hi", "user_id": "1234567890"}
auth = HTTPBasicAuth(api_key, None)
requests.post(url, json=data, auth=auth)
http -a a6xE5yLe0RHPYbiHqR3OKDmRgsZ76RY3: \
https://api.meya.ai/receive user_id=1234567890 text=hi