User subscription API can be used to retrieve all the subscription(s) of the user for your application.
It provides all information related to the user subscriptions(s) that are associated to the user such as-
- Accetptance of SLB T&C: "hasAcceptedTerms": true (A user is requried to accept the latest SLB Digital T&C to proceed with using any SLB Digital offerings. In case they have not accepted the SLB Digital T&C, the API will not return any subscriptions to restrict the access.)
- Subscription details - User: userId, billingAccountId, billingAccountName, contractId, departmentId, departmentName
- Subscription details - Product Deployment: endpointID, instance, region
- Subscription details - Product & Application: product, featureSets etc.
Once an application has identified the context of the user under which user is trying to access the application, the application should use CCM-User-Subscription-Service to verify user's subscription under given context. The user should be allowed to access application if they have subscription under current context. This validation should be at the contract level (using “contractId” parameter)
- In order to access the service, you are required to have the AppKey and the AccessToken. Below are the steps to get the appKey and AccessToken.
- [AppKey] can be obtained from My Apps. Make sure your App subscribes CCM product.
- [Access Token] can be obtained by sending request below using SLB Authenticator
SLB Authenticator information can be found in SAUTH
- Trying out the API
Example Request
curl -X 'GET' \
'https://api.delfi.slb.com/ccm/userSubscription/v2/userSubscriptions?appCode=[app-code]&groupId=[product-groupId]' \
-H 'Authorization: Bearer [token]' \
-H 'accept: application/json' \
-H 'appkey: <your-app-key>'NOTE
- The API returns active subscriptions associated with the user specified in the provided user token, given that the user has accepted the latest SLB Digital T&Cs.
- At least one of groupId, appCode or billingAccountId is required.
- If query parameters are specified, then the results are filtered using an AND operation.
- The user is identified through their user-principal, as indicated by the email claim in the JWT token within the authorization header.
AppCode of the clientId used in the token request should match with the provided appCode in the request Param.
Example Successful Response
{
"hasAcceptedTerms": true,
"userSubscriptions": [
{
"contractId": "string",
"billingAccountId": "string",
"billingAccountName": "string",
"subscriptions": [
{
"departmentId": "string",
"departmentName": "string",
"subscriptionId": "string",
"region": "string",
"endpointID": "string",
"instance": "string",
"userId": "string",
"durationId": "string",
"product": {
"description": "string",
"partNumber": "string",
"name": "string",
"code": "string",
"groupId": "string",
"featureSets": [
{
"applicationName": "string",
"applicationCode": "string",
"name": "string",
"type": "string",
"claims": [
"string"
]
}
],
"productType": "string"
}
}
]
}
]
}| Response Parameters | Type | Description |
|---|---|---|
| hasAcceptedTerms | boolean | True if user has accepted latest terms and conditions |
| contractId | string | ContractId is the ID for the Contract, with which user's subscription was approved |
| billingAccountId | string | billingAccountId is the ID for the Billing Account |
| billingAccountName | string | Billing account name |
| departmentId | string | departmentId is the CCM Auto-Generated ID for the Department |
| departmentName | string | department name |
| subscriptionId | string | subscriptionId is the CCM Auto-Generated ID for the Subscription |
| region | string | Region of the endpoint registered in SLB Digital Platform |
| endpointID | string | A unique id issued for the endpoint (instance) registered in SLB Digital Platform |
| instance | string | URL of the endpoint registered in SLB Digital Platform |
| userId | string | userId is the user email retrieved from user token |
| durationId | string | Commitment duration selected in Digital Home at the time of approving a subscription request |
| description | string | Description of the Product |
| partNumber | string | Unique id of the product |
| name(Product schema) | string | Name of the product |
| code | string | Code assigned for Product |
| groupId | string | Product group id |
| applicationName | string | Name of application whose access is granted by product subscription |
| applicationCode | string | Unique application code |
| name(feature set schema) | string | Name of feature set grouping feature claims of an application |
| type | string | Type of feature set e.g. Base, Add-On |
| claims | array | feature claims representing access to various workflows within an application |
| productType | string | Type of Product (e.g. Domain profile, Plugin etc.) |