Hey I’m trying to get the user’s info so I can send it to a database for their account. I have an issue I cannot wrap my head fully around. This is my code.
<?php require_once '../vendor/autoload.php'; use Patreon\API; use Patreon\OAuth; $client_id = 'TheClientId'; $client_secret = 'TheClientSecret'; $redirect_uri = "https://redirect.com"; $access_token = "Users access token"; $api_client = new API($access_token); $current_member = $api_client->fetch_user(); $email = $current_member['data']['attributes']['email'];?>
With this I get the error “Uncaught Error: Cannot use object of type Art4\JsonApiClient\Document as array” on the email line. What is the correct way to format that line so I can get the email of the user?