I’m trying to make a program to get the private posts of this campaign. I have an account that pledged to that campaign, so in my account i have access to those private posts, I’m just trying to get their info programmatically.
To that end, I made an oauth client by following all the steps described in the oatuh docs.
Using the oauth process I’m successfully getting the secret token, so I think that’s not the problem. The problem is that when I hit the campaign posts endpoint, it returns me an empty result:
The scope of the token includes campaigns.posts as requested by the docs. All the scopes of the token are: campaigns campaigns.posts identity identity.memberships campaigns.members campaigns.members[email] campaigns.members.address
It gives me the exact same empty result. It was actually one of the first things I tried, but since the docs asked for the campaigns.posts scope, I thought the problem could be the creator token not having this scope and decided to make a client implementing the full OAuth2 flow. That was my way of making sure the scope was correct.
I also did a double check to see if I didn’t get the campaign id wrong, and it seems correct too. Asking for info about this campaign, I got:
which is indeed the campaign I want. The result above was the same with the creator token and with the token obtained via OAuth. It’s just the posts endpoint that seems to not be working for me
That’s a good lead. Since creator token has all the related scopes, you should be able to pull posts. If that’s not happening, the call may have an issue. You can check how the WP plugin does posts call to compare to your own call:
I have this exact problem, I include the correct campaigns.posts scope, I use the creator token and I send the correct request for getting posts, but they’re always empty.
The sign in process also doesn’t show the campaigns.posts, even if it’s included in the
url (I include all scopes)
I checked that code and the way it is calling the API seems to be the exact same way I’m doing. The only real difference is that they include the ?page[count]=<page_size> query param. I went back to my requests and added that parameter too. Got the exact same empty result as before.
I do have an Wordpress installation for tests lying around, so I decided to go ahead and install the plugin and call that class directly in a page:
I can reproduce this. I also noticed that when I was doing the OAuth flow. I thought it was weird but didn’t think too much about it. But now that you pointed that out and on second thought, this might be a clue that maybe they silently dropped support for this. Or maybe a bug in the API, since the wordpress plugin uses it too?
I’m not sure how post sync works, but I imagine it syncs the posts in your account to your wordpress, using your creator token.
If that’s how it works, it’s slightly different from the use case I’m presenting here. My use case is getting the posts from another creator I have a pledge on (hence I have access to their private posts) with my creator token. That’s what’s not working.
As a test, I created a sample post in my campaign and was able to retrieve it using the posts endpoint. I imagine post sync does something similar to this. But that’s not quite what I’m interested in. I want to get access to another’s creator posts.
I’m trying to fetch my own posts from my campaign (ie. the one associated to the oauthed account) and I still can’t do it, it always returns an empty array. Both scopes and the request are correct and I’ve doubled checked with the WP code as well
@codebard in your test, do you get any mention about posts on Patreon’s page during the oauth? I don’t understand why it’s the only scope not shown there, while all others are visible
Posts should not be included in the scopes like that and you should be able to get your posts with your creator token without issues. You can try using the exact calls which the WP plugin is using and see if that produces a result.
Either should work as long as they are the creator token. Wp’s setup wizard can create it, as well as going to register clients page and creating it yourself.