Account Authentication
Weavr authenticates your API requests using your API keys. If you do not include your key when making an API request or you include an invalid API key, Weavr will respond with a 401 - Unauthorized HTTP error.
When you open a Sandbox account, Weavr generates keys for you. You can use these keys in the Sandbox environment only. These are different from the keys for the Live environment, which you will receive later.
Weavr will provide you with two types of keys:
- You use the API key to authenticate yourself when you make API requests. You should keep this key secret and should only store it securely on your servers. You should never use this key to call Weavr’s APIs directly from the UI.
- You use the UI key to identify your account when you use Weavr’s UI component library. This key isn’t secret and therefore you can store it in your JavaScript code or in an Android or iPhone app.
Obtaining Your Keys
We generate your keys automatically when you open your account. You can find your keys in the Multi Portal. Remember that we will generate a different set of keys for you when you upgrade your account to the Live environment.
In total, you will have 4 keys: an API key and a UI key for the Sandbox environment and an API key and a UI key for the Live environment.
Using Your Keys
You should include the API key in the header of every API request. The name of the header is api-key
and its value should be your API key.
You should include the UI key when initialising the UI library by calling the init
method.