GX Technology : APIs - Internal - Entitlements

Information

Entitlements. Each entitlement is built up of a name and a key. There can be many with the same name so they need to have both the name and they key.

If there is a null end date it means the entitlement does not end.

If there is a null start date it means the entitlement will come into effect immediately. All entitlements coming back should have a date returned.

Get Account Entitlements

GET /axis/account/entitlements/v1/{product}/{accountId}

Retrieves entitlements for a given account.

Request URL Parameters

NameTypeDescription
productstringThe key of the product the account is associated with
accountIdstringThe primary key of the account


Response

HTTP 200

Indicates that zero or more entitlements were found associated with the account.

{
    "success": true,
    "message": null,
    "items": [{
        "name": "DDL_DEMO_EXTRAS",
        "key": "DDLDEMO",
        "startDate": 1481187680000,
        "endDate": null,
        "accountId": "{4CDBAD44-3CF3-4CF2-A0EA-1D3C938D4DA1}"
    }],
    "count": 1
}

The Entitlement model is as follows

NameTypeRequiredDescription
nameStringyesSee the get all entitlements call for this String value
keyStringyesSee the get all entitlements call for this String value
startDateLongNoIf start date is null it means it starts effective immediately. Epoch in milliseconds
endDateLongNoIf end date is null it means that there is no ending to the entitlement. Epoch in milliseconds
accountIdStringyesThe account Id.

 

HTTP 400

Indicates the request failed due to bad input. The message will contain details of what was invalid.

HTTP 401

Indicates that the user is not logged in

HTTP 403

Indicates the user is logged in but not allowed to view entitlements on this account

HTTP 500

Indicates that the server was unable to fulfill the request for an unknown reason

Get Entitlement Options

GET /axis/account/entitlements/v1/{product}/entitlements/all

{
  "success": true,
  "message": null,
  "items": [{
    "key": "DDLDEMO",
    "name": "DDL_DEMO_EXTRAS"
  }, {
    "key": "PCS561284",
    "name": "DISNEYXD_SPRINT_SPRINTTV"
  }, {
    "key": "wapapjvs650299",
    "name": "ESPN_ATT_MVP_THREE"
  }
}


Add Entitlement

POST /axis/account/entitlements/v1/{Product}/{AccountId}

Adds an entitlement to an account.

Request URL Parameters

NameTypeDescription
productstringThe key of the product the account is associated with
accountIdstring

The primary key of the account

Request Body

{
    "name":"DISNEYXD_SPRINT_SPRINTTV",
    "key":"PCS561284",
    "accountId": "{4CDBAD44-3CF3-4CF2-A0EA-1D3C938D4DA1}",
    "startDate": 1481087680000,
    "endDate": 1481187640000
}

Alternate request body:

{
    "name":"DISNEYXD_SPRINT_SPRINTTV",
    "key":"PCS561284",
    "accountId": "{4CDBAD44-3CF3-4CF2-A0EA-1D3C938D4DA1}",
    "startDate": null,
    "endDate": null
}

 

Remove Entitlement

DELETE /axis/account/entitlements/v1/{Product}/{AccountId}/{Name}/{Key}

HTTP 404

Indicates the entitlement could not be located for deletion