FOR DEVELOPERS

To integrate your newspaper website with the Glimta Unlock marketplace, you need to take these steps:

1: Create a free user account.

Go to https://glimta.com/publisher/sites
Log on using your Google or Facebook account. Or create a Glimta account.

2. Add your site.

Screenshot 2019-01-18 16.35.41.png
Note: The “Enable this site” makes it live for Glimta Unlock customers. See Testing at the end of this page.

 

3: Select what kind of paywall integration you like to use.

Screenshot 2019-01-18 15.15.28.png

There are currently five different ways to integrate your paywall with Glimta:

Simple Proxy

The Simple Proxy is a quick-and-dirty solution that gives our developers a stomach ache…The proxy removes the paywall script code from the article and sends the result to the reader.
Pros:
Quick, no technical integration needed.
The proxy is not open to the public, it only responds to special, unique Glimta URLs.

Cons:
The URLs needs to start with https://glimta.com/u/…
Only works with some newspapers.
When the newspaper site changes something in the paywall code or HTML, the Proxy might stop working.

We are only offering the Proxy as a quick-start solution, not a permanent solution!


Proxy with IP

“Proxy with IP” is a little bit better: You need to configure your paywall to allow full access to the content (i.e remove the paywall) from our ip number/s.

Pros:
Quick, easy to integrate.

Cons:
The URLs needs to start with glimta.com


Client-Side Script

If you are using a client-side paywall (i.e the content is sent out to everyone but some code in the browser makes it readable for subscribers only), you can use the  “Client Side Script” integration.

See the sample code below the setting
Screenshot 2019-01-18 15.31.13.png


Server-Side Script

The unlock token will be added to the page’s url as a query string parameter named “glimta”.
For example: https://www.example.com/some-locked-news-article?glimta=ABC123

You need to add code to your servers backend that looks for this parameter, and if found, executes a query towards GLIMTAs REST-endpoint “https://service.glimta.com/uss/<token>” to check if the unlock is valid or not.
For example: https://service.glimta.com/uss/ABC123

If you want to exclude bot’s from retrieving content behind the paywall, simply forward the requesting users “User-Agent” string with Your call to the Glimta endpoint and we will filter out requests coming from GoogleBot, TwitterBot et.c.

The responses to this call is:

# VALID
status: HTTP_200
body:
{
    "status": true
}

# EXPIRED
status: HTTP_402
body:
{
    "status": false,
    "expired": true,
    "expired_date": "yyyy-mm-dd"    // can be null
    "expired_total": 0..nn          // can be null
}

# BOT
status: HTTP_403
body:
{
    "status": false,
    "is_bot: true
}

# NOT FOUND (i.e. non-existant token)
status: HTTP_404
body: Null

If the check above succeeds, You need to run code on your server that removes the paywall for this request and also insert a clientside script “https://glimta.com/script.js”.

A simple (and naive) implementation in Python might look something like below:

import requests

...

# Your Server's GET requests endpoint
def get(request):

    # get Glimta unlock token from querystring
    glimta_token = request.args.get("glimta")

    if glimta_token:

        # call GLIMTA REST-api to check if unlock is valid
        r = requests.get("https://service.glimta.com/uss/" + glimta_token)

        if r.status_code == 200:

            # TODO:

            # 1 ADD CODE TO REMOVE THE PAYWALL

            # 2 INCLUDE THE SCRIPT "https://glimta.com/script.js" IN THE PAGE HTML


The “Full Oauth2 Integration” is something we are testing for our upcoming subscription offerings.

Note: This is only available to beta publishing partners.


4: Choose what pricing you like to present to the customers.

You can do this later. (Or let someone at Marketing worry about price levels).

Tip: in order to play around with Glimta Unlock, you can set a fake price for an old article that is unlikely to be entered by anyone else but you.

In the Economics tab, click on Add Url Sales Rule.
Screenshot 2019-01-18 15.44.59.png

Have fun!
Please let us know what we can improve.