sharepoint online – Access denied. You do not have permission to perform this action or access this resource. for getUserpermissions

I am trying to get permissions of user by consuming REST api from Java Client and after executing code . it shows

Access denied. You do not have permission to perform this action or access this resource

Here is the URL:

https://xxxxx.sharepoint.com/_api/web/getUserEffectivePermissions('i%3A0%23.f%7Cmembership%7Cprasad.shelke%40xxxxx.onmicrosoft.com')