Subscribe an account to a product
Request
To subscribe an account to a product, send a POST request to:
http://<host>:<port>/rmg/v1/operator/entitlements
Mandatory fields
accountID
– the ID of the account to subscribe to the productproductID
– the ID of the productvalidityType
– the validity type:ABSOLUTE
– rental duration and consumption window start at the time of purchase.RELATIVE
– the consumption window starts at the time of purchase, but the rental duration starts when the content is first viewed.
productType
–TRANSACTIONAL
,SUBSCRIPTION
,FREE
, orCAPABILITY
validFrom
– the start date/time of the product entitlement's validityexpiryDate
– the end date/time of the product entitlement's validity
Example
A request with this payload subscribes the specified account to the specified product:
{
"accountId": "5b34af949f0cd1000106f4fe",
"productId": "PROVIDER_ID_001_PROVIDER_RESOURCE_ID_001",
"validityType": "ABSOLUTE",
"productType": "SUBSCRIPTION",
"validFrom": "2016-04-06T13:47:59.228Z",
"expiryDate": "2020-04-06T13:47:59.228Z"
}
Response
A successful request returns an HTTP 201 status. The response includes the ID of the entitlement.
The calling system should keep a record of the entitlement ID and associate it with the account. If you need to unsubscribe the account from the product (that is, to remove the entitlement), you will need the entitlement ID.
See the Rights Manager (RMG) API documentation for details of the failure error codes.
Example
{
"_id": "5b3a31c3a601cf0001cf671e"
}
See also
For full details of this API, see the Rights Manager (RMG) API documentation.