Adding an entitlement to an account
Request
To add an entitlement to an account, send a POST request to:
https://<host>:<port>/crm-gateway/v1/rmg/v1/entitlements
Headers
x-correlation-id
– identifier for logging, to correlate messages across a call flowAuthorization
– Keycloak access token (see Accessing operator APIs using Keycloak)Content-Type: application/json
Mandatory arguments
All of the following arguments are in the request body:
productId
– the ID of the product for which the entitlement is being addedaccountId
– the ID of the account for which the entitlement is being addedvalidityType
– the entitlement type (ABSOLUTE
orRELATIVE
)productType
– the product type (TRANSACTIONAL
,SUBSCRIPTION
,FREE
,CAPABILITY
, orPPV
)validFrom
– the entitlement validity start date/time in ISO 8601 formatexpiryDate
– the entitlement validity end date/time in ISO 8601 format
Other arguments
prohibitDuplicateProductPurchase
(in query) – if set totrue
, duplicate products with overlapping validity dates cannot be purchased, unless the existing entitlement is for a specific device. Default:false
.capabilityType
(on body) – the type of capability. (Note that this argument is only mandatory whenproductType
isCAPABILITY
.)deviceId
(in body) – the ID of the device for which the entitlement is being added.If device-specific products are enabled:
- If you specify a device ID, the entitlement applies for the specified device only.
- If no device ID is specified, the entitlement is added at the account level.
If device-specific products are not enabled, all entitlements apply at the account level, and the products that they apply to can be consumed on any off the account's devices.
For details of how to enable or disable device-specific products, see Device specific products.
See the CRM Gateway API documentation for the full list of additional arguments.
Example
A POST request with this payload adds a capability entitlement for Netflix to the specified account:
{
"productId": "product1234",
"accountId": "account1234",
"validityType": "ABSOLUTE",
"productType": "CAPABILITY",
"validFrom": "2022-04-26T11:01:46.082Z",
"expiryDate": "2023-04-26T11:01:46.082Z",
"capabilityType": "NETFLIX"
}
Response
A successful request returns an HTTP 201 status.
A bad request returns an HTTP 400 status.
A forbidden request returns an HTTP 403 status.
If the specified tenant does not exist, the request returns an HTTP 404 status.
See the CRM Gateway API documentation for the specific error codes and their meanings.
Example
{
"_id": "abc1234"
}
Here, _id
is the ID of the newly-created entitlement.
See also
- For full details of this API, see the CRM Gateway API documentation.
- For client app integration details, see Use entitlements to enable/disable capabilities.
- For information on how to define capabilities and enable them per entity in OpCon, see:
- Defining Capabilities
- Enabling/disabling capabilities on entities:
- To enable device-specific products in OpCon, see Device specific products.
- For ingest information, see the
clientControls
element in theeditorialChannel
,event
, andeditorialContent
elements in Metadata ingest format.