Hi, I would like to add a small banner on my site that notifies users what their current pledge level is. This would be useful for a number of purposes, including the creation of customized messages (“This content is locked, you can access it for only X dollars more!”), as well as troubleshooting (e.g. the recent OAuth stumble).
Currently I am trying the following, just to get a dump of the user data so I know what I’m working with. I cribbed this code from the plugin files, and plopped it into header.php just to see what would happen.
<?php
$api_client = new Patreon_API($user_meta['patreon_access_token'][0]);
$patreon_user = $api_client->fetch_user();
var_dump($patreon_user);
?>
However, I get the error message
The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.
Can anyone get me pointed in the right direction? Do I need to call this from functions.php? Is there some authorization function I have to call first?