When you’re authenticated you can access a patron’s email address, however, it’s worth noting that for a reason I’m not sure about, the Patreon API can be accessed in 2 ways which I consider to be “authenticated” and “unauthenticated”. The related
links that the API includes are to the “unauthenticated” endpoints, these do not expose private information (e.g: email) unless you’re accessing the unauthenticated endpoint with an active patreon.com session (via your browser).
My recommendation from my experience working with the Patreon platform is that you should ignore the related links: they are not helpful if you’re trying to work with authenticated access.
The Patreon API implements the JSON API specification, which separates out relation attributes from the relations reference. You need to make use of a JSON API client for your chosen platform or you need to parse the JSON yourself to extract the relation data.
For example, a request to campaigns/{campaign}/pledges
would return something like this:
{
"data": [
{
"attributes": {
"declined_since": null
},
"id": "1",
"relationships": {
"creator": {
"data": {
"id": "123",
"type": "user"
},
"links": {
"related": "https://www.patreon.com/api/user/123"
}
},
"patron": {
"data": {
"id": "456",
"type": "user"
},
"links": {
"related": "https://www.patreon.com/api/user/456"
}
}
},
"type": "pledge"
}
],
"included": [
{
"attributes": {
"about": "",
"created": "2015-10-31T17:59:02+00:00",
"facebook": null,
"first_name": "John",
"full_name": "John Doe",
"gender": 0,
"image_url": "https://c8.patreon.com/2/400/456",
"last_name": "Doe",
"thumb_url": "https://c8.patreon.com/2/400/456",
"twitch": null,
"twitter": null,
"url": "https://www.patreon.com/user?u=456",
"vanity": null,
"youtube": null
},
"id": "1",
"relationships": {
"campaign": {
"data": null
}
},
"type": "user"
}
]
}
Therefore to obtain the patron’s email address you need to extract it from the included
data. I’d highly recommend using a JSON API client for your platform of choice rather than trying to write your own parser, or ideally if you’re on a platform that has one available then use a Patreon library which hydrates entities for you so you don’t need to do any of this yourself.
Specific to your goal (get a list of email addresses for all of your patrons), if you don’t mind using PHP for this, my Patreon PHP Library can extract a list of all your patrons email addresses in a couple of lines, e.g:
use Squid\Patreon\Patreon;
$patreon = new Patreon('creator_access_token');
$campaign = $patreon->campaigns()->getMyCampaignWithPledges();
echo $campaign->pledges->map(function ($pledge) {
return $pledge->patron->email;
})->implode(', ');