Getting campaignId's for users memberships using api/oauth

We’re building a oauth-integration with patreon to get information about which campaigns they are a member of. So far we got the oauth working, but when requesting the data as we understand the documentation the campaign info is empty. Is there anything obvious that we’re missing?

We request the auth token using the following scopes: [“identity”, “identity.memberships”, “campaigns”]

Using the access token we make a request to this url: https://www.patreon.com/api/oauth2/v2/identity?include=memberships,campaign

For a user with one campaign we get the following result:
{
“data”: {
“attributes”: {},
“id”: “29009124”,
“relationships”: {
“campaign”: {
“data”: null
},
“memberships”: {
“data”: [
{
“id”: “f29e647d-9458-4961-bd51-12b5bdaabf5e”,
“type”: “member”
}
]
}
},
“type”: “user”
},
“included”: [
{
“attributes”: {},
“id”: “f29e647d-9458-4961-bd51-12b5bdaabf5e”,
“type”: “member”
}
],
“links”: {
“self”: “https://www.patreon.com/api/oauth2/v2/user/29009124
}
}

The docs states:

If you request Campaign and memberships, you will receive information about the user’s memberships and the Campaigns they are Member of, provided you have the campaigns and identity[memberships] scopes.

I’m assuming that the scope identity[memberships]really should be identity.memberships, but other than that I don’t understand what could be wrong. Could it be that you need to specify the fields returned for the campaign?

1 Like

I can’t believe it’s been a year without answer… but see here: In v2, how do I get a campaign ID from the identity endpoint?

you need to ?include=memberships.campaign and you only need the identity.memberships scope. You don’t need campaigns.

1 Like

Yep. The situation with the api was pretty different last year.

For any call, using v2 clients, and using v2 tokens created via v2 clients and calling the v2 endpoints with v2 calls are the best. If you mix those, then you may experience issues, despite how api tries to make those different versions work together. It does that pretty well, but still i wouldnt recommend mixing them.