Last updated

User Subscription Service

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)

Steps to access the service

  1. 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

  1. 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 ParametersTypeDescription
hasAcceptedTermsbooleanTrue if user has accepted latest terms and conditions
contractIdstringContractId is the ID for the Contract, with which user's subscription was approved
billingAccountIdstringbillingAccountId is the ID for the Billing Account
billingAccountNamestringBilling account name
departmentIdstringdepartmentId is the CCM Auto-Generated ID for the Department
departmentNamestringdepartment name
subscriptionIdstringsubscriptionId is the CCM Auto-Generated ID for the Subscription
regionstringRegion of the endpoint registered in SLB Digital Platform
endpointIDstringA unique id issued for the endpoint (instance) registered in SLB Digital Platform
instancestringURL of the endpoint registered in SLB Digital Platform
userIdstringuserId is the user email retrieved from user token
durationIdstringCommitment duration selected in Digital Home at the time of approving a subscription request
descriptionstringDescription of the Product
partNumberstringUnique id of the product
name(Product schema)stringName of the product
codestringCode assigned for Product
groupIdstringProduct group id
applicationNamestringName of application whose access is granted by product subscription
applicationCodestringUnique application code
name(feature set schema)stringName of feature set grouping feature claims of an application
typestringType of feature set e.g. Base, Add-On
claimsarrayfeature claims representing access to various workflows within an application
productTypestringType of Product (e.g. Domain profile, Plugin etc.)