getAccessStatus()

Usage

CleengApi.getAccessStatus(offerId, callback);

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

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.

Params

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

Example

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

Output

{
    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 API Reference