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}

Sample URL
http://localhost:8095/ms-entitlement-api/api/v1.0.0/system/entitlements/users/{userId}
Response
{
	"entitlements": [
        {
            "userId": "string",
            "resourceId": "string",
            "roles": [
                "string"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceCategory": "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}/actions

Sample URL
http://localhost:8095/ms-entitlement-api/api/v1.0.0/system/entitlements/users/{userId}/actions
Response
{
    "entitlements": [
        {
            "resourceId": "string",
            "roles": [
                {
                    "role": "string",
                    "actions": [
                        "string",
                        "string",
                        "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 resource
This API is used to add entitlements by userId and resourceId.

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

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

        "roles": [
          "string",
          "string"
        ],
  
      "serviceid": "string",
      "channelid": "string",
      "customfilterid": "string",
      "resourceCategory": "string"
    }
  ]
}

Sample Response
{
    "entitlements": [
        {
            "userId": "string",
            "resourceId": "string",
            "roles": [
                "string",
                "string"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceCategory": "string"
        },
        {
            "userId": "string",
            "resourceId": "string",
            "roles": [
                "string",
                "string"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceCategory": "string"
        }
    ]
}
Get resource
This API is used to get entitlements by resourceId and userId.

GET/system/entitlements/{userId}/resources/{resourceId}

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

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 resource
This API is used to delete entitlements by resourceId and userId.

DELETE/system/entitlements/{userId}/resources/{resourceId}

Sample URL
http://localhost:8095/ms-entitlement-api/api/v1.0.0/system/entitlements/{userId}/resources/{resourceId}
Response
{
    "entitlements": [
        {
            "userId": "string",
            "resourceId": "string",
            "roles": [
                "string",
                "string"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceCategory": "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",
      "serviceid": "string",
      "channelid": "string",
      "customfilterid": "string",
      "roles": [
        "string"
      ],
      "resourceCategory": "string"
    }
  ]
}
Sample Response
  {
    "entitlements": [
        {
            "userId": "string",
            "resourceId": "string",
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "roles": [
                "string"
            ],
            "resourceCategory": "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"
          ]
        },{
          "mode": "rem",
          "roles": [
            "string"
          ]
        }
      ],
      "resourceCategory": "string",
      "serviceid": "string",
      "channelid": "string",
      "customfilterid": "string"
    }
  ]
}
Sample Response
  {
    "entitlements": [
        {
            "userId": "string",
            "resourceId": "string",
            "roles": [
                {
                    "roles": [
                        "string"
                    ]
                }
            ],
            "resourceCategory": "string",
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string"
        }

    ]
}
Delete entitlements by resource
This API is used to delete entitlements by resource.

DELETE/system/entitlements/resources/{resourceId}

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

GET/system/entitlements/resources/{resourceId}

Sample URL
http://localhost:8095/ms-entitlement-api/api/v1.0.0/system/entitlements/resources/{resourceId}
Response
{
    "entitlements": [
        {
            "userId": "string",
            "resourceId": "string",
            "roles": [
                "test"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceCategory": "string"
        }
    ]
}
ADD entitlements
This API is used to add entitlements by userId in the entitlements database.

POST/system/entitlements/users/{userId}:

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

PUT/system/entitlements/users/{userId}:

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

DELETE/system/entitlements/users/{userId}:

Sample URL
http://localhost:8095/ms-entitlement-api/api/v1.0.0/system/entitlements/users/{userId}:
Response
{
    "entitlements": [
        {
            "userId": "string",
            "resourceId": "string",
            "roles": [
                "string",
                "string"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceCategory": "current"
        },
        {
            "userId": "string",
            "roles": [
                "string",
                "string"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceCategory": "current",
            "resourceFilter": "string"
        }
    ]
}
Get computed resource by user id
This API is used to get entitlements based on userId.

GET/system/entitlements/resources/users/{userId}

Sample URL
http://localhost:8095/ms-entitlement-api/api/v1.0.0/system/entitlements/resources/users/{userId}
Response
{
    "entitlementResource": [
        {
            "resourcecategories": [
                "string"
            ],
            "roleId": [
                "string"
            ],
            "resources": [
                "string"
            ],
            "resourcefilters.customerId": [
                "string"
            ]
        }
    ]
}

Copyright © 2020- Temenos Headquarters SA

Published on :
Tuesday, October 5, 2021 11:13:26 AM IST

Feedback
x