Getting Updated Sourcepoint Script Using API

To assist in meeting your integration needs, SourcePoint exposes a Server-Side Script API that returns the latest release of either our detection or recovery script. The API supports delivering the script as external unblocked resource, an inline script to be placed on page, or as plain JavaScript to be bundled as part of your deployment process.

Creating An Authorization Token SourcePoint uses API keys to allow access to the API. You can register and expire your API keys through our dashboard.

Once authenticated, either click on your email address at the top right and select ‘API keys’ or visit api_keys directly. To create a new key, enter a name and press ‘Create Key’. To invalidate an existing key, click the x under the ‘Remove’ header.

Sourcepoint expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: Token token=your_api_key

Calling the API Endpoints Once you have the authorization token, you can now download the appropriate Javascript library for your use case by making a GET request to the right endpoint for the library. The API endpoints below can be used programmatically to retrieve any of the Javascript libraries.

To help illustrate their use, examples of curl commands that can be used to retrieve the appropriate script for your use case are below.

Note: Each of these examples uses a dummy authorization token of "gnpAXMORzQaCZwETKyPzabLwYVfJaHdbdDcTBqPOLneZLRTuAy".

Bootstrap Endpoint This endpoint is for sites that are using our asynchronous bootstrap loader with adblock protection. This is generally used for sites leveraging the adblock messaging use case.

curl -H "Authorization: Token gnpAXMORzQaCZwETKyPzabLwYVfJaHdbdDcTBqPOLneZLRTuAy" ""

Messaging Complete Endpoint This code is for sites that want to run messaging for general messaging, consent, messaging and adblock messaging. Sites interested in general and consent messaging only will generally use the messaging without detection library.

curl -H "Authorization: Token gnpAXMORzQaCZwETKyPzabLwYVfJaHdbdDcTBqPOLneZLRTuAy" ""

Messaging Without Detection Endpoint This code is for sites that want to run messaging for general and consent messaging only. It does not contain adblock detection components.

curl -H "Authorization: Token gnpAXMORzQaCZwETKyPzabLwYVfJaHdbdDcTBqPOLneZLRTuAy" ""

Enhanced Detection Endpoint This code contains our enhanced detection for use cases where the site wants to detect adblockers, but deliver their own message. The code necessary to deliver a message is not included in this library.

curl -H "Authorization: Token gnpAXMORzQaCZwETKyPzabLwYVfJaHdbdDcTBqPOLneZLRTuAy" ""

Detection Reporting Endpoint This code is used for reporting on adblockers only. It cannot be used for delivering a message.

curl -H "Authorization: Token gnpAXMORzQaCZwETKyPzabLwYVfJaHdbdDcTBqPOLneZLRTuAy" ""