Forum Discussion

qinglau's avatar
qinglau
Mentor
12 years ago

Get permission denied in REST API call

Hi All, 

 

Have you someone try to use http://yourcommunity/community_id/restapi/vc/settings this call to grab setttings. 

 

When I try to login with community manager account, i have response back. 

 

<response status="success"><settings type="settings" href="/settings"><setting name="admin.default_to_legacy" type="string">false</setting><setting name="alert.enabled" type="string">false</setting><setting name="alert.from_email" type="string">dev@lithium.com</setting><setting name="alert.from_name" type="string">Dev</setting><setting name="alert.to_email" type="string">dev.pager@lithium.com</setting><setting name="alert.to_name" type="string">Dev Pager</setting><setting name="analytics.chat_average_cost" type="string">6.63</setting><setting name="analytics.chat_percent_of_incidents" type="string">10</setting><setting name="analytics.email_average_cost" type="string">7.48</setting><setting name="analytics.email_percent_of_incidents" type="string">15</setting><setting name="analytics.phone_average_cost" type="string">10.23</setting><setting name="analytics.phone_percent_of_incidents" type="string">75</setting><setting name="analytics.robot_percent_of_views" type="string">40</setting><setting name="analytics.solution_percent_of_views" type="string">33</setting><setting name="app.id" type="string"/><setting name="app_creator.enabled" type="string">false</setting><setting name="app_creator.mode" type="string"/><setting name="ban.results_per_page" type="string"/><setting name="blog.archive_frequency" type="string">weekly</setting><setting name="blog.blogroll" type="string"/><setting name="blog.comments_per_page_num" type="string">50</setting><setting name="blog.enable_comments" type="string">true</setting><setting name="blog.enable_drafts" type="string">true</setting><setting name="blog.enable_enable_social_bookmarks" type="string">true</setting><setting name="blog.enable_google_blog_search_ping" type="string">true</setting></settings></response>

 

However, when i try to do that with another user which will response permission denied. I went to user permission setting, and grant the user permission to make REST API CALLS. (See the settings in attachment) 

 

<response status="error">
<error code="303">
<message>Permission Denied</message>
</error>
</response>

 Would you please tell me what i have to do to grant the permission. 

 

Cheers,

Qing Liu 

 


8-21-2013 3-56-44 PM.png
  • The ability to access community-level settings is typically restricted to Administrators. Specifically, I believe the user must have the "Update Communities" permission granted in order to read or modify community-level settings. 

     

    Typically the only settings that a regular user will be able to access are their own user settings. For example:

    /restapi/vc/users/self/settings

     

    It's strange that you're getting a permission denied error, though. I would have expected the response to just contain an empty settings node, for example:

    <response status="success">
    <settings type="settings" href="/settings"/>
    </response>

     

    Are you able to make any other REST API requests successfully as that user?

  • Hi Adam, 

     

    I found out that it is permission setting problem. I turn the rest call into restadmin. 

     

    Thanks 

  • AdamN's avatar
    AdamN
    Khoros Oracle

    The ability to access community-level settings is typically restricted to Administrators. Specifically, I believe the user must have the "Update Communities" permission granted in order to read or modify community-level settings. 

     

    Typically the only settings that a regular user will be able to access are their own user settings. For example:

    /restapi/vc/users/self/settings

     

    It's strange that you're getting a permission denied error, though. I would have expected the response to just contain an empty settings node, for example:

    <response status="success">
    <settings type="settings" href="/settings"/>
    </response>

     

    Are you able to make any other REST API requests successfully as that user?

    • qinglau's avatar
      qinglau
      Mentor

      Hi Adam, 

       

      I found out that it is permission setting problem. I turn the rest call into restadmin. 

       

      Thanks