Weird, I used the scopes you provided, and I am able to get the members only for my (this) Creator account.
I tried with 2 other accounts and all i get nothing
// Output from other patreon accounts
relationships: {
memberships: {
data: [],
},
},
// Output from my patreon account
relationships: {
memberships: {
data: [
{
id: "fb2b0e96-not-real-0000-00000000",
type: "member",
}, {
id: "fb2b0e96-not-real-0000-00000000",
type: "member",
}, {
id: "fb2b0e96-not-real-0000-00000000",
type: "member",
}
],
},
},
Probably I do something else wrong, no idea.
That’s how i get the data in both cases.
Summary
const { code, state } = req.query;
const tokenResponse = await fetch('https://www.patreon.com/api/oauth2/token', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({
code: code as string,
grant_type: 'authorization_code',
client_id: config.patreonClientId,
client_secret: config.patreonClientSecret,
redirect_uri: config.patreonRedirectUri
})
});
// <code> to await for token blabla
const userResponse = await fetch('https://www.patreon.com/api/oauth2/v2/identity?include=memberships&fields%5Buser%5D=full_name,email&fields%5Bmember%5D=email,full_name,patron_status,will_pay_amount_cents,campaign_lifetime_support_cents,last_charge_date,last_charge_status,next_charge_date,pledge_cadence,pledge_relationship_start', {
headers: { 'Authorization': `Bearer ${tokenData.access_token}` }
});
I’ll play a bit more with this, I just started an hour ago or so,
Thanks for the tip