Authentication

There are two kind of authentication supported by Apercite.

The first one, and lighter one, is called client-side authentication, and uses your API Key only (the Public Key). As this authentication type is not 100% safe, only a subset of our APIs are available using this method, and we apply stronger limits to this usage. Those limits are sufficient for web usage, but not for server side usage.

The second one, stronger, is called server-side authentication, and use both your API Key and API Secret (the Private Key) to sign the requests. All API methods are available using this method, and the limits are much more slack as we know for sure the requests come from you.

Client-Side Authentication

This is only suitable for in-browser auth. You’ll include a javascript in your HTML that will make your visitors consume API calls on your behalf. We’ll only count you credits after we validated a cryptographic exchange with your visitors, even if we already displayed the images.

To make it short, include the following in your <head> tag:

<script src="[[ ENDPOINT ]]/api/[[ apikey ]].js"></script>

We’ll handle the rest.

Server-Side Authentication

For strongest authentication, or because you’d like to send batched requests, you can use server-side encryption to securely sign your requests.

You should use one of our official libraries to do so (stay tuned, they will be published soon).