Forum Discussion

jaikumar1's avatar
jaikumar1
Mentor
6 years ago

API permission issue

Hi,

As we have a requirement to get the unread mail count for each users. We just identified the API 

/restapi/vc/users/id/[id] /mailbox/notes/inbox

So while trying to use the API, it returns the following error message,

 

<response status="error">
<error code="303">
<message>
User -1 does not have the following permission(s) at o2uk: [ allow_manage_users ]
</message>
</error>
</response>

 

 

As a admin user also unable to access it. So could you please suggest me how to resolve the issue.

 

  • Hi jaikumar1 ,

    If you are facing permissions issue on hitting browser API. You can directly call the API in Endpoint or in Custom component. You will not face same permission issue over there.

    If you want to see the XML data how it will look like. you can check this article for all related nodes.

  • jaikumar1 Are you passing in an API session key when making the call? The "User -1" would tend to indicate that the API sees you as an anonymous user. If you haven't already, you might try obtaining an API session key for an admin user and see if you still receive the same error.

    Parshant is correct that you would likely not run into the same issue if using the restadmin context object in an endpoint or custom component, though you may need to still ensure that your endpoint/component is properly permissioned/secured to avoid any security risks. 

  • Hi jaikumar1 ,

    If you are facing permissions issue on hitting browser API. You can directly call the API in Endpoint or in Custom component. You will not face same permission issue over there.

    If you want to see the XML data how it will look like. you can check this article for all related nodes.

  • AdamN's avatar
    AdamN
    Khoros Oracle

    jaikumar1 Are you passing in an API session key when making the call? The "User -1" would tend to indicate that the API sees you as an anonymous user. If you haven't already, you might try obtaining an API session key for an admin user and see if you still receive the same error.

    Parshant is correct that you would likely not run into the same issue if using the restadmin context object in an endpoint or custom component, though you may need to still ensure that your endpoint/component is properly permissioned/secured to avoid any security risks. 

    • jaikumar1's avatar
      jaikumar1
      Mentor

      Thank you Parshant  and AdamN ,

      I have tried to validate the API in browser, before to use the API in component. After started access the API in component it's working fine and it return the result.