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/{externaluserId}/entitlements

Sample URL
https://j7nvrho2zb.execute-api.eu-west-2.amazonaws.com/test-primary/v1.0.0/party/customers/userIds/ROLFGERLING/entitlements?
Response
{
    "items": [
        {
            "resourceName": "account",
            "entitlementss": [
                "GB0010001-78956",
                "GB0010001-79038",
                "GB0010001-79065"
            ]
        }
    ]
}
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://<<host>>:<<port>>/ms-entitlement-api/api/v1.0.0/system/entitlements/resources/users/2900086473289?serviceid=string&channelid=string&customfilterid=string
Response
{
    "entitlementResource": [
        {
            "resourcecategories": [
                "savings"
            ],
            "roleId": [
                "PaymentsDomesticCreator"
            ],
            "resources": [
                "78963"
            ],
            "resourcefilters": [
                "{"filterValue":["896541276"],"filterName":["creditAccount"],"filterOperation":["notEqual"]}"
            ]
        },
        {
            "resourcecategories": [
                "savings"
            ],
            "roleId": [
                "PaymentApprover"
            ],
            "resources": [
                "78965"
            ],
            "resourcefilters": [
                "{"filterValue":["896547156"],"filterName":["creditAccount"],"filterOperation":["equal"]}"
            ]
        }
    ]
}

Managment APIs

ADD resource
This API is used to add entitlements by userId and resourceId.

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

Sample URL
http://<<host>>:<<port>>/ms-entitlement-api/api/v1.0.0/system/entitlements/users/2900086473289/resources/78999
Sample Request
{
  "entitlements": [
    {
      "roles": [
        "PaymentApprover"
      ],
      "serviceid": "string",
      "channelid": "string",
      "customfilterid": "string",
      "resourceCategory": "savings"
    }
  ]
}
Sample Response
{
    "entitlements": [
        {
            "userId": "2900086473289",
            "resourceId": "78999",
            "roles": [
                "PaymentApprover"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceCategory": "savings"
        }
    ]
}
Get resource
This API is used to get entitlements by resourceId and userId.

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

Sample URL
http://<<host>>:<<port>>/ms-entitlement-api/api/v1.0.0/system/entitlements/users/2900086473289/resources/78999?serviceid=string&customfilterid=string&channelid=string
Response
{
    "entitlements": [
        {
            "userId": "2900086473289",
            "resourceId": "78999",
            "roles": [
                "PaymentApprover"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceCategory": "savings"
        }
    ]
}
update resource
This API is used to modify the entitlements by resource.

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

Sample URL
http://<<host>>:<<port>>/ms-entitlement-api/api/v1.0.0/system/entitlements/users/2900086473289/resources/78999
Sample Request
{
  "entitlements": [
    {
      "resourceCategory": "savings",
      "serviceid": "string",
      "channelid": "string",
      "customfilterid": "string",
      "roles": [
        {
          "mode": "add",
          "roles": [
            "BalanceViewer"
          ]
        }
      ]
    }
  ]
}
Sample Response
{
    "entitlements": [
        {
            "userId": "2900086473289",
            "resourceId": "78999",
            "resourceCategory": "savings",
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "roles": [
                {
                    "roles": [
                        "PaymentApprover",
                        "BalanceViewer"
                    ]
                }
            ]
        }
    ]
}
Delete resource
This API is used to delete entitlements by resourceId and userId.

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

Sample URL
http://<<host>>:<<port>>/ms-entitlement-api/api/v1.0.0/system/entitlements/users/2900086473289/resources/78999?serviceid=string&customfilterid=string&channelid=string}
Response
{
    "entitlements": [
        {
            "userId": "2900086473289",
            "resourceId": "78999",
            "roles": [
                "PaymentApprover",
                "BalanceViewer"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceCategory": "savings"
        }
    ]
}
ADD Entitlements By Resource
This API is used to add entitlements by resource.

POST/system/entitlements/resources/{resourceId}

Sample URL
http://<<host>>:<<port>>/ms-entitlement-api/api/v1.0.0/system/entitlements/resources/78999
Sample Request
{
  "entitlements": [
    {
      "userId": "1928885555",
      "serviceid": "string",
      "channelid": "string",
      "customfilterid": "string",
      "roles": [
        "PaymentsDomesticCreator"
      ],
      "resourceCategory": "saving"
    }
  ]
}
Sample Response
{
    "entitlements": [
        {
            "userId": "1928885555",
            "resourceId": "78999",
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "roles": [
                "PaymentsDomesticCreator"
            ],
            "resourceCategory": "saving"
        }
    ]
}
update entitlement by resource
This API is used to modify entitlements by resource.

PUT/system/entitlements/resources/{resourceId}

Sample URL
http://<<host>>:<<port>>/ms-entitlement-api/api/v1.0.0/system/entitlements/resources/78999
Sample Request
{
    "entitlements": [
        {
            "userId": "1928885555",
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceCategory": "saving",
            "roles": [
                {
                    "mode": "add",
                    "roles": ["PaymentApprover"]
                }
            ]
        }
    ]
}
Sample Response
 {
    "entitlements": [
        {
            "userId": "1928885555",
            "resourceId": "78999",
            "roles": [
                {
                    "roles": [
                        "PaymentsDomesticCreator",
                        "PaymentApprover"
                    ]
                }
            ],
            "resourceCategory": "saving",
            "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://<<host>>:<<port>>/ms-entitlement-api/api/v1.0.0/system/entitlements/resources/78999?customfilterid=string&serviceid=string&channelid=string
Response
{
    "entitlements": [
        {
            "userId": "1928885555",
            "resourceId": "78999",
            "roles": [
                "PaymentsDomesticCreator",
                "PaymentApprover"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceCategory": "saving"
        }
    ]
}
Get entitlements by resource
This API is used to get entitlements by resource.

GET/system/entitlements/resources/{resourceId}

Sample URL
http://<<host>>:<<port>>/ms-entitlement-api/api/v1.0.0/system/entitlements/resources/78999?customfilterid=string&serviceid=string&channelid=string
Response
{
    "entitlements": [
        {
            "userId": "1928885555",
            "resourceId": "78999",
            "roles": [
                "PaymentsDomesticCreator"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceCategory": "saving"
        }
    ]
}
ADD entitlements by user ID
This API is used to add entitlements by userId in the entitlements database.

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

Sample URL
http://<<host>>:<<port>>/ms-entitlement-api/api/v1.0.0/system/entitlements/users/2900086473289
Sample Request
{
  "entitlements": [
    {
      "serviceid": "string",
      "channelid": "string",
      "customfilterid": "string",
      "resources": [
        {
            "roles": [
                "PaymentsDomesticCreator"
            ],
            "resourceFilter": "creditAccount!=896541276"
        },{
            "roles": [
                "PaymentsDomesticCreator"
            ],
            "resourceId": "78963",
            "resourceCategory":"savings"
        },{
            "roles": [
                "PaymentApprover"
            ],
            "resourceFilter": "creditAccount=896547156"
        },{
            "roles": [
                "PaymentApprover"
            ],
            "resourceId": "78965",
            "resourceCategory":"savings"
        }
      ]
    }
  ]
}
Sample Response
{
    "entitlements": [
        {
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resources": [
                {
                    "userId": "2900086473289",
                    "roles": [
                        "PaymentsDomesticCreator"
                    ],
                    "resourceFilter": "creditAccount!=896541276"
                }
            ]
        },
        {
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resources": [
                {
                    "userId": "2900086473289",
                    "resourceId": "78963",
                    "roles": [
                        "PaymentsDomesticCreator"
                    ],
                    "resourceCategory": "savings"
                }
            ]
        },
        {
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resources": [
                {
                    "userId": "2900086473289",
                    "roles": [
                        "PaymentApprover"
                    ],
                    "resourceFilter": "creditAccount=896547156"
                }
            ]
        },
        {
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resources": [
                {
                    "userId": "2900086473289",
                    "resourceId": "78965",
                    "roles": [
                        "PaymentApprover"
                    ],
                    "resourceCategory": "savings"
                }
            ]
        }
    ]
}
Get entitlements by user ID
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://<<host>>:<<port>>/ms-entitlement-api/api/v1.0.0/system/entitlements/users/2900086473289?customfilterid=string&channelid=string&serviceid=string
Response
{
    "entitlements": [
        {
            "userId": "2900086473289",
            "roles": [
                "PaymentsDomesticCreator"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceFilter": "creditAccount!=896541276"
        },
        {
            "userId": "2900086473289",
            "resourceId": "78963",
            "roles": [
                "PaymentsDomesticCreator"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceCategory": "savings"
        },
        {
            "userId": "2900086473289",
            "roles": [
                "PaymentApprover"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceFilter": "creditAccount=896547156"
        },
        {
            "userId": "2900086473289",
            "resourceId": "78965",
            "roles": [
                "PaymentApprover"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceCategory": "savings"
        }
    ]
}
Update entitlements by user ID
This API is used to modify the existing entitlements by userId.

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

Sample URL
http://<<host>>:<<port>>/ms-entitlement-api/api/v1.0.0/system/entitlements/users/2900086473289
Sample Request
{
  "entitlements": [
    {
      "serviceid": "string",
      "channelid": "string",
      "customfilterid": "string",
      "resources": [
        {
          "resourceId": "78963",
          "mode": "add",
          "roles": [
           "PaymentsCreator"
          ],
          "resourceCategory":"savings"
        }
      ]
    }
  ]
}
Sample Response
{
    "entitlements": [
        {
            "userId": "2900086473289",
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resources": [
                {
                    "resourceId": "78963",
                    "roles": [
                        "PaymentsDomesticCreator",
                        "PaymentsCreator"
                    ],
                    "resourceCategory": "savings"
                }
            ]
        }
    ]
}
Delete entitlements by user ID
This API is used to delete the entitlements by userId.

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

Sample URL
http://<<host>>:<<port>>/ms-entitlement-api/api/v1.0.0/system/entitlements/users/2900086473289?customfilterid=string&channelid=string&serviceid=string
Response
{
    "entitlements": [
        {
            "userId": "2900086473289",
            "roles": [
                "PaymentsDomesticCreator"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceFilter": "creditAccount!=896541276"
        },
        {
            "userId": "2900086473289",
            "resourceId": "78963",
            "roles": [
                "PaymentsDomesticCreator",
                "PaymentsCreator"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceCategory": "savings"
        },
        {
            "userId": "2900086473289",
            "roles": [
                "PaymentApprover"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceFilter": "creditAccount=896547156"
        },
        {
            "userId": "2900086473289",
            "resourceId": "78965",
            "roles": [
                "PaymentApprover"
            ],
            "serviceid": "string",
            "channelid": "string",
            "customfilterid": "string",
            "resourceCategory": "savings"
        }
    ]
}

Copyright © 2020- Temenos Headquarters SA

Published on :
Wednesday, October 12, 2022 7:06:04 PM IST

Feedback
x