API Keys & Environments
Environments
There are three environments in Miso:
- Playground, a read-only tutorial environment that anyone can use to explore Miso features with sample data.
- Development, for staging, QA, and experimentation.
- Production, for managing your live integration with Miso.
Accessing your environments programmatically
You can access a Miso environment by passing in the corresponding API key in your API calls. There is one publishable key and one secret key per environment. The API keys are per team (not per user).
Accessing your environments in Miso’s dashboard
In Miso, you are always viewing the data and configuration for one environment at a time. To switch between your environments, use the dropdown in the upper left-hand corner.
API Keys
There are two types of keys associated with each of your environments: A secret API key and a publishable API key. You can find the API keys in Miso .
Use your API keys
There are two ways to use the keys in your API calls:
- Pass it as a request parameter (
api_key
) - Pass it as a request header (
X-API-KEY
)
For example, to pass the key as a parameter:
curl -X POST -d ... https://api.askmiso.com/v1/interactions?api_key={{your_api_key}}
To pass the key as a header:
curl -X POST -H “X-API-KEY={{your_api_key}}” -d ... https://api.askmiso.com/v1/interactions
Publishable API key
Use your publishable API key to call Miso's APIs from your front-end code. This key has limited access to APIs and is safe to be exposed in public. You can use it to send user interaction events from the browser using Miso's Interactions Upload API .
With the publishable API key, you can also access search and recommendation APIs. Note that when you specify user_id
in the payload, you have to supply a corresponding user_hash
as well. Please see Keeping your data secure for further information.
Publishable API keys provide protection against bot traffic. If you use tools like Postman or the curl command to test the APIs locally and encounter a block, use the secret key instead.
Keep in mind that once you include or use any API key in your front-end code, it becomes public. In order to keep the secret API key secure, you should only use a publishable API key in public areas, such as browsers or client devices.
Secret API key
You can access every Miso API endpoint with your secret API key.
It is important to keep the secret API key secure and only use it on a back-end server. Never expose the key in client-side JavaScript code, a public repository, a browser, or client device. If the private key is compromised, you can revoke it in Miso and get a new one.
Publishable API Key | Secret API Key | |
---|---|---|
API Access | Interaction upload, Search(with user_hash ), Recommendation (with user_hash ) | All APIs |
Safe to expose | Yes | No |
Bot detection | Yes | No |
Where to use | Front-end | Back-end, Postman, curl |