Authorization

This article provides information on how to use the API keys to integrate your site or app with our platform.

The APIs that we provide are an easy to use and a fairly flexible way to send data from your site or app to our platform. However, we need to authenticate the incoming requests (also, to protect our resources). Our APIs are based on REST/JSON and requests to them are authenticated with your API keys. You can use the APIs to send interaction-stream (events), user information, or your item catalog.

To try API endpoints you must obtain the API keys and use the correct URL to access the Blueshift API endpoints.

Obtain the API keys

To obtain the API keys, log into the Blueshift app, go to Account Settings and then to the API keys tab.

You can obtain the following API keys, based on your role:

  • Event API key (EVENT_API_KEY)
  • Users API key (USER_API_KEY). The User API keys are visible only to admin users.

Identify the API endpoint URL to access the Blueshift API endpoints

Ensure that you use the correct URL to access the Blueshift API endpoints. The API endpoint URL depends on the Blueshift region for your Blueshift app.

  • API endpoint URL for the EU region - api.eu.getblueshift.com
  • API endpoint URL for the Rest of the world - api.getblueshift.com

When you try the API endpoints, you must set the Base URL to the correct API endpoint URL.

Using the API keys

When you try to access an API endpoint to either send data or generate a report, you have to pass one of the API keys so that we know that an incoming request comes from an authorized source.

For example, the sample API call to trigger a campaign looks like:

curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '
  {
    "email": "<EMAIL ADDRESS>",
    "campaign_uuid": "<CAMPAIGN UUID>",
    "attribute 1": "<abc>",
    "attribute 2": "<xyz>"
  }' -u <USER API KEY>: https://api.getblueshift.com/api/v1/campaigns/execute