# API Error: You are not permitted to view the requested resource

**URL:** <https://meta.discourse.org/t/api-error-you-are-not-permitted-to-view-the-requested-resource/35035>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [October 28, 2015, 10:30pm UTC](https://meta.discourse.org/t/api-error-you-are-not-permitted-to-view-the-requested-resource/35035 "2015-10-28T22:30:08Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![erik\_chan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erik_chan/32/115850_2.png) [@erik\_chan](https://meta.discourse.org/u/erik_chan)\
**Post date:** [October 28, 2015, 10:30pm UTC](https://meta.discourse.org/t/api-error-you-are-not-permitted-to-view-the-requested-resource/35035/1 "2015-10-28T22:30:09Z")

</div>

I am receiving the following error:

```
DiscourseApi::UnauthenticatedError: 
{"errors"=>["You are not permitted to view the requested resource."], "error_type"=>"invalid_access"}

```

when I make the ruby API call ‘category\_latest\_topics’

```
response = client.category_latest_topics("<some_category>") 

```

This is due to the category permissions (the category is not public). I tried to authenticate by using

```
client.api_username = "system"  

```

and making sure “system” is a member of the group that has permissions to the category but still no luck! Any suggestions or workarounds?

---

_[View the full topic](https://meta.discourse.org/t/api-error-you-are-not-permitted-to-view-the-requested-resource/35035)._
