# Getting an error while trying to fetch individual posts

**URL:** https://meta.discourse.org/t/getting-an-error-while-trying-to-fetch-individual-posts/224255
**Category:** General
**Created:** [April 14, 2022, 10:28am UTC](https://meta.discourse.org/t/getting-an-error-while-trying-to-fetch-individual-posts/224255 "2022-04-14T10:28:32Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 14, 2022, 4:19pm UTC](https://meta.discourse.org/t/getting-an-error-while-trying-to-fetch-individual-posts/224255/2 "2022-04-14T16:19:43Z")

</div>

~~Here is an authorization header that I use in Ruby:~~

~~headers = { ‘Authorization’ =\> “Bearer #{do\_api\_key}” }~~

~~So I think that you need to add `Bearer ` beforeyour api key.~~

Here are headers:

```
         headers = { 'api-key' => discourse_api_key, 'api-username' => 'system' }

```

So I think you need headers like those. [Discourse REST API Documentation](https://meta.discourse.org/t/discourse-api-documentation/22706) is supposed to help with that.

---

_[View the full topic](https://meta.discourse.org/t/getting-an-error-while-trying-to-fetch-individual-posts/224255)._
