getAccessStatus()


Usage

Returns the information if current visitor has access to selected offer.

CleengApi.getAccessStatus(offerId, callback);

NOTICE! There are two ways of using this method. The first is checking access to one, particular offer for some country like for US (look at the request example).

The second way is to check if the user has access to the offer in any country. To do so, just skip the country tag suffix. For example:

Offer ID WITH the country suffix: S580476507_US The same offer ID WITHOUT country suffix: S580476507

Note: This method is not secure and should be used only as a helper method. Your integration entitlement validation should be based on server side getAccessStatus method.

Parameters:

  • offerId identifier of an offer you want to sell
  • callback function called after popup window is closed (see example below)

- required parameter

Example:

CleengApi.getAccessStatus('S543962233_US', function(result) {
        if (result.accessGranted) {
            alert('You have access to this offer!');
        }
    });

Response:

{
        accessGranted: true, // information if customer has access to content
        grantType: "direct-purchase", // how the access was granted for customer
        expiresAt: "1455899791", // till when access is valid
        purchasedDirectly: true
    }

Back to Customer API