# How to get post attributes

**URL:** <https://www.patreondevelopers.com/t/how-to-get-post-attributes/4301>\
**Category:** Friendly Help\
**Created:** [March 15, 2021, 10:38am UTC](https://www.patreondevelopers.com/t/how-to-get-post-attributes/4301 "2021-03-15T10:38:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamieernest](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/jamieernest/32/1655_2.png) [@jamieernest](https://www.patreondevelopers.com/u/jamieernest)\
**Post date:** [March 15, 2021, 10:38am UTC](https://www.patreondevelopers.com/t/how-to-get-post-attributes/4301/1 "2021-03-15T10:38:43Z")

</div>

Hello, I am pretty new to the patreon API and I am trying to make a JS application to parse data from a post. The API mentions how to make a GET request to get a post by its id, but when I do that it just gives me a 200 and doesnt give me any attributes. I am aware that in API v2 I have to provide what attributes I would like, but `https://www.patreon.com/api/oauth2/v2/posts/{id}?fields=url,title` still returns me a 200 with no attributes, so what syntax should I use to get the attributes?

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [March 15, 2021, 3:27pm UTC](https://www.patreondevelopers.com/t/how-to-get-post-attributes/4301/2 "2021-03-15T15:27:05Z")

</div>

Patreon WordPress already has a good implementation of post syncing. You can use its logic to port to your app:

> <https://github.com/Patreon/patreon-wordpress/blob/36a690f778fc0cb704be325d521e7c26f4fa5c5b/classes/patreon_api_v2.php#L122>

That is for the api call. Webhook call should be in the same file.

> <https://github.com/Patreon/patreon-wordpress/blob/36a690f778fc0cb704be325d521e7c26f4fa5c5b/classes/patreon_routing.php#L611>

That is for receiving the webhook from Patreon for new posts.

> <https://github.com/Patreon/patreon-wordpress/blob/36a690f778fc0cb704be325d521e7c26f4fa5c5b/classes/patreon_wordpress.php#L2906>

And thats the logic which creates the webhook.

> <https://github.com/Patreon/patreon-wordpress/blob/master/classes/patreon_content_sync.php>

The above file is where post sync logic is kept and how posts are synced.

---

<div class="post-metadata">

**Author:** ![jamieernest](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/jamieernest/32/1655_2.png) [@jamieernest](https://www.patreondevelopers.com/u/jamieernest)\
**Post date:** [March 15, 2021, 4:06pm UTC](https://www.patreondevelopers.com/t/how-to-get-post-attributes/4301/3 "2021-03-15T16:06:15Z")

</div>

Sorry I think you got what I meant wrongly… What I mean was I was trying to use [this](https://docs.patreon.com/?javascript#get-api-oauth2-v2-posts-id) function to get some data from the post i.e. title, content etc (the app recieves a link from the user and it sends the data via discord), and for example the syntax for getting address info about a user is `https://www.patreon.com/api/oauth2/v2/members/{member_id}?fields[address]=line_1,line_2,addressee,postal_code,city` what would be the equivalent for getting info about a post?

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [March 17, 2021, 4:45pm UTC](https://www.patreondevelopers.com/t/how-to-get-post-attributes/4301/4 "2021-03-17T16:45:10Z")

</div>

> <https://github.com/Patreon/patreon-wordpress/blob/36a690f778fc0cb704be325d521e7c26f4fa5c5b/classes/patreon_api_v2.php#L145>

---

<div class="post-metadata">

**Author:** ![lokimckay](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/lokimckay/32/2402_2.png) [@lokimckay](https://www.patreondevelopers.com/u/lokimckay)\
**Post date:** [July 28, 2023, 1:40pm UTC](https://www.patreondevelopers.com/t/how-to-get-post-attributes/4301/5 "2023-07-28T13:40:52Z")

</div>

Square brackets are not valid?

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/patreondevelopers/original/2X/5/55f3ea53446c01f50c5bdfdfbe74e6f6af47b7bb.png)

---

<div class="post-metadata">

**Author:** ![lokimckay](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/lokimckay/32/2402_2.png) [@lokimckay](https://www.patreondevelopers.com/u/lokimckay)\
**Post date:** [July 28, 2023, 1:46pm UTC](https://www.patreondevelopers.com/t/how-to-get-post-attributes/4301/6 "2023-07-28T13:46:09Z")

</div>

Ah, check here: [API Reference](https://docs.patreon.com/#requesting-specific-data)

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/patreondevelopers/original/2X/b/be5909fbd587cf5f643d8b0e91200b23644880e6.png)
