How to get post attributes

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?

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

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

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

And thats the logic which creates the webhook.

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

Sorry I think you got what I meant wrongly… What I mean was I was trying to use this 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?

Square brackets are not valid?

Ah, check here: API Reference

1 Like