subscription-key

subscription-key #

All requests to the Blicker API endpoints are required to be accompanied by a subscription-key. This is a secret key with which your organization can identify itself while making the request. The subscription key must be sent as a header.

Obtaining a subscription key #

You can obtain a subscription key from your organization on this portal after creating an account. You can either sign up to Blicker and create your own organization or join an existing organization through an invite email.

After signing up, you can create subscription keys for your personal account or for any possible organization you’ve joined by first switching to the respective account or organization. After this, go to the manage subscriptions page to create and manage your subscription keys.

Best practices #

It is common for organizations to have multiple subscription keys. Firstly, it is recommended to create at least one subscription key for internal testing and development, and separate this from the actual production data. Furthermore, some organizations may want to create separate subscription keys for different parts of their organization. As an example, an organization may want to have separate subscription keys for end-users and their own employees, or separate keys for the different regions in which they operate.

Note that a subscription key is also bound to a region in which data will be processed and stored. If an organization operates in multiple regions of the world, multiple subscriptions keys may be needed to accommodate for this.

The subscription key is a secret key which should never be made publicly available. That also means that it should not be included as part of client applications (websites, mobile apps, etc.) where third-parties may be able to access the code. If users are able to directly access the API using your code then it’s not possible to control how they use it. Instead, we recommend that you set up a server-side application that exposes its own API to end users to make requests on behalf of them. This API can then perform its own access control and rate limiting, e.g. requiring an access code that is sent to end users through physical mail.

Example requests #

In contrast to regular request parameters which are sent as the multipart/form-data payload, the subscription key is sent as a header.

curl -X 'POST' \
  'https://api.blicker.ai/blicker/2020-10-01' \
  -H 'subscription-key: <your subscription key>' \
  -F 'image=@test_image.jpg'
from pathlib import Path
from pprint import pprint

import requests

response = requests.post(
    "https://api.blicker.ai/blicker/2020-10-01",
    headers={"subscription-key": "<your subscription key>"},
    files={"image": ("test_image.jpg", Path("test_image.jpg").read_bytes())},
)

pprint(response.json())