Hey @Athos_K, I am an engineer at Patreon and I have been investigating the issue you are facing.
Here is what I tried:
- I used your “Login with Patreon” button to OAuth with a test account.
- I fetched its access token.
- Using the access token, I was able to query the user endpoint and get a valid response.
I was not able to reproduce any timeouts and the API responded in a timely matter.
I used this code:
use Patreon\API;
use Patreon\OAuth;
// TODO: replace with your credentials
$client_id = "";
$client_secret = "";
// TODO: replace with a valid token gotten from https://docs.patreon.com/#step-4-validating-receipt-of-the-oauth-token
$access_token = "";
$oauth_client = new OAuth($client_id, $client_secret);
$api_client = new API($access_token);
$patron_response = $api_client->fetch_user();
$patron = $patron_response->get('data');
// This did return the patron's first name
echo($patron->attribute('first_name'));
It would help me if you could answer the following questions?
- Are you also using patreon-php 0.3.1?
- Is
$api_client->fetch_user()
consistently not answering for you? - Is there something different in your setup compared to the code snippet I shared that I should be aware of?
PS: It will require some work but the v2 API should be significantly faster. It might be worth giving it a try https://docs.patreon.com/#apiv2-oauth