APIs

This section covers the details of the APIs supported by Entitlement microservices.

Business APIs

Get Entitlements
This API is used to get all the entitlements stored in the ms_entitlements_entitlement table. It is just a plain get which queries and returns the response to you.

GET/party/customers/userIds/{userId}/entitlements

Sample URL
http://localhost:8095/ms-entitlement-api/api/v1.0.0/party/customers/userIds/{userId}/entitlements
Response
[
  {
    "resourceName": "string",
    "entitlements": [
      "string"
    ]
  }
]
          
Get user entitlements
This API is used to get all the user entitlements along with the roles stored in the ms_entitlements_entitlementdata table. It is just a plain get which queries and returns the response to you.

GET/system/entitlements/users/{userId}?serviceid=clientwebService&channelid=web&customfilterid=test

Sample URL
http://localhost:8095/ms-entitlement-api/api/v1.0.0/system/entitlements/users/{userId}?serviceid=clientwebService&channelid=web&customfilterid=test
Response
[
  {
    "resourceId": "string",
    "roles": [
      "string"
    ]
  }
]
Get entitlements with actions
This API is used to get all the user entitlements along with the permitted actions. It is just a plain get which queries and returns the response to you.

GET/system/entitlements/users/{userId}?serviceid=string&channelid=string&customfilterid=string

Sample URL
http://localhost:8095/ms-entitlement-api/api/v1.0.0/system/entitlements/users/{userId}?serviceid=string&channelid=string&customfilterid=string
Response
[
    "entitlements": [
        {
            "resourceId": "string",
            "roles": [
                {
                    "role": "string",
                    "actions": [
                        "string",
                        "string"
                    ]
                }
            ]
        }
    ]
}

Managment APIs

There are eleven APIs to the management part. The main functionality is to manage the CRUD operations in the entitlements database.

ADD entitlements
This API is used to add entitlements on a resource in the entitlements database.

POST/system/entitlements/users/{userId}/resources/{resourceId}

Sample URL
http://localhost:8080/ms-campaign-api/api/v1.0.0/system/entitlements/users/{userId}/resources/{resourceId}
Sample Request
{
  "roles": [
    "string"
  ],
"channelid":"string",
"customfilterid":"string",
"serviceid":"string"
}

Sample Response
{
  "roles": [
    "string"
  ]
}
Get user entitlement on resource
This API is used to get the list of entitlements on a resource.

GET/system/entitlements/users/{userId}/resources/{resourceId}?serviceid=string&channelid=string&customfilterid=string

Sample URL
http://localhost:8095/ms-entitlement-api/api/v1.0.0/system/entitlements/users/{userId}/resources/{resourceId}?serviceid=string&channelid=string&customfilterid=string
Response
{
  "roles": [
    "string"
  ]
}

update entitlements
This API is used to modify the existing entitlements on a resource. Mode can be either ā€˜A’ or ā€˜D’.

PUT/system/entitlements/users/{userId}/resources/{resourceId}

Sample URL
http://localhost:8080/ms-campaign-api/api/v1.0.0/system/entitlements/users/{userId}/resources/{resourceId}
Sample Request
{
  "entitlements": [
    {
      "mode": "add",
      "roles": [
        "string"
      ]
    },
    {
      "mode": "rem",
      "roles": [
        "string"
      ]
    }
  ],
"channelid":"string",
"customfilterid":"string",
"serviceid":"string"
}
Sample Response
{
  "entitlements": [
    {
      "roles": [
        "string"
      ]
    }
  ]
}
Delete entitlements
This API is used to delete user entitlement on a resource.

DELETE/system/entitlements/users/{userId}/resources/{resourceId}? serviceid=string&channelid=string&customfilterid=string

Sample URL
http://localhost:8095/ms-entitlement-api/api/v1.0.0/system/entitlements/users/{userId}/resources/{resourceId}? serviceid=string&channelid=string&customfilterid=string
Response
{
  "roles": [
    "string"
  ]
}
ADD Entitlements By Resource
This API is used to add entitlements by resource.

POST/system/entitlements/resources/{resourceId}

Sample URL
http://localhost:8080/ms-campaign-api/api/v1.0.0/system/entitlements/resources/{resourceId}
Sample Request
{
  "entitlements": [
    {
      "userId": "string",
      "roles": [
        "string"
      ]
    }
  ],
"channelid":"string",
"customfilterid":"string",
"serviceid":"string"
}
Sample Response
{
  "entitlements": [
    {
      "userId": "string",
      "roles": [
        "string"
      ]
    }
  ]
}
update entitlement by resource
This API is used to modify entitlements by resource.

PUT/system/entitlements/resources/{resourceId}

Sample URL
http://localhost:8080/ms-campaign-api/api/v1.0.0/system/entitlements/resources/{resourceId}
Sample Request
{
  "entitlements": [
    {
      "userId": "string",
      "roles": {
        "mode": "add",
        "roles": [
          "string"
        ]
      }
    }
  ],
"channelid":"string",
"customfilterid":"string",
"serviceid":"string"
}
Sample Response
{
  "entitlements": [
    {
      "userId": "string",
      "roles": {
        "mode": "add",
        "roles": [
          "string"
        ]
      }
    }
  ]
}
Delete entitlements by resource
This API is used to delete entitlements by resource.

DELETE/system/entitlements/resources/{resourceId}?serviceid=string&channeled=string&customfilerid=string

Sample URL
http://localhost:8095/ms-entitlement-api/api/v1.0.0/system/entitlements/resources/{resourceId}?serviceid=string&channeled=string&customfilerid=string
Response
{
  "entitlements": [
    {
      "userId": "string",
      "roles": {
        "roles": [
          "string"
        ]
      }
    }
  ]
}
Get entitlements by resource
This API is used to get entitlements by resource.

GET/system/entitlements/resources/{resourceId}?serviceid=string&channeled=string&customfilerid=string

Sample URL
http://localhost:8095/ms-entitlement-api/api/v1.0.0/system/entitlements/resources/{resourceId}?serviceid=string&channeled=string&customfilerid=string
Response
{
  "entitlements": [
    {
      "userId": "string",
      "roles": [
        "string"
      ]
    }
  ]
}
ADD entitlements
This API is used to add entitlements based on user id.

POST/system/entitlements/users/{userId}

Sample URL
http://localhost:8080/ms-campaign-api/api/v1.0.0/system/entitlements/users/{userId}
Sample Request
{
    "entitlements": [{
            "resourceId": "string",
            "roles": [
               "string"
            ]
        }
    ],
  "channelid":"string",
  "customfilterid":"string",
  "serviceid":"string"
}
Sample Response
{
    "entitlements": [
        {
            "resourceId": "string",
            "roles": [
                "string"
            ]
        }
    ]
}
Update entitlements
This API is used to modify the existing entitlements based on the user id.

PUT/system/entitlements/users/{userId}

Sample URL
http://localhost:8080/ms-campaign-api/api/v1.0.0/system/entitlements/users/{userId}
Sample Request
{
    "entitlements": [ {
            "resourceId": "string",
            "mode": "rem",
            "roles": [
                "string"
            ]
        }
    ], 
  "channelid":"string",
  "customfilterid":"string",
  "serviceid":"string"
}
Sample Response
{
    "entitlements": [
        {
            "resourceId": "string",
            "roles": [
                "string"
            ]
        }
    ]
}
Delete entitlements
This API is used to delete user entitlement based on the user id.

DELETE/system/entitlements/users/{userId}?serviceid=string&channeled=string&customfilerid=string

Sample URL
http://localhost:8095/ms-entitlement-api/api/v1.0.0/system/entitlements/users/{userId}?serviceid=string&channeled=string&customfilerid=string
Response
{
    "items": [
        {
            "resourceId": "string",
            "roles": [
                "string"
            ]
        }
    ]
}

Bookmark Name Actions
Feedback
x