Api.patreon.com endpoint changed

Looks like somebody made a change affecting the API between the mornings of Fri 2019-09-27 and Sat 2019-09-28.
This used to work: https://api.patreon.com/oauth2/api/
This now works: https://api.patreon.com/api/oauth2/api/

Best I can tell, it’s likely related to you guys implementing v2 of the API and possibly trying to get people using www_patreon_com instead of api_patreon_com (weird, why?!). I’m basing that on all of the v2 examples now using the “/api/oauth2/api/” path (as well as the www host). So probably api was moved to www w/o accounting for the different paths?

I’ve patched my code - well, your PHP package - to work. It’d be great to know if that’s going to be fixed to work as it originally did. From the other (mostly wordpress) complaints I see from the past 24 hours, I’m guessing y’all will have to make the old path work again - maybe both?

This person seems to have realized the same issue as well, it’s just buried.
/t/patreon-connect-plugin-causing-405-error/2290/3

1 Like

Can I ask what files did you have to patch to fix this?

I’m using Patreon-PHP v0.3.1, so this is for that, though I imagine it’s roughly the same in older versions.

The file is src/Patreon/API.php .
If you’ve installed the package in, say, Laravel, that will be more like:
vendor/patreon/patreon/src/Patreon/API.php

On line 62, change:
$api_endpoint = “https://api.patreon.com/oauth2/api/” . $suffix;
to
$api_endpoint = “https://api.patreon.com/api/oauth2/api/” . $suffix;

They might switch it back, so don’t forget that if it breaks back to what it was supposed to be.

3 Likes

jessedp you are a god-send!
I just patched them in wordpress and it worked!

For the wordpress plugin there are two files “patreon_api.php” and “patreon_oauth.php”.
both in “/wordpress/wp-content/plugins/patreon-connect/classes/”

Modify the urls as jessedp-sama said.

Thanks! I’m using the Wordpress plugin and I changed it, but no luck on my end (I’m using the API v2).
Try to unlock a post returns “Sorry. Could not acquire your info from Patreon. Please try again later.”.
I suppose I’ll have to wait until Patreon fix the issue on their end.

I did, but no luck… Probably because I’m using the API v2.

I think the is an “patreon_api_v2.php” file maybe that one. also I recopied my Client ID keys, saved permalinks and had to re-save each page using the plugin to get it to work.

Investigating. Will issue an update to solve this as soon as a reliable fix determined.

1 Like

I just want to point out that the workaround jessedp shared works if you are using the API V1. I’m using V2 and I’m still getting the patreon_couldnt_acquire_user_details warning. There’s definitely something broken out there.

Im able to login without issues using api v2. Which plugin version are you using ricky?

Version 1.3.2. I also updated the Patreon tokens but no luck. Funny thing is it broke all of a sudden.

I have confirmed the old endpoint properly working with old v1 using clients. WP plugin, and it should also be valid for PHP client and any other v1 app.

Please check out your integrations, and revert the endpoint if necessary.

It’s working again! Thanks.

1 Like

You know this, but I’ll confirm that both v1 endpoints work again for me via the aforementioned PHP library and curl. Thanks.

1 Like