Patreon APIv2 is in Public Beta!


#23

I had it working with v1 and I’m trying to move the the v2 but I’m getting an error:
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.

I’m passing the header ‘Authorization: Bearer [access_token]’ like before on v1.
The only thing I really changed is the endpoint url.

What else do I need to do to make it works?


#24

since you guys announced this API Beta, some users reported a error in my “perfect working system” lol

all was fine before, but now, some users obtain a error when my code calls the line:

userResponse = apiClient.fetchUser();

This is the error:

Line: 235 - com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field “url” (class com.patreon.resources.shared.SocialConnections$UserIdObject), not marked as ignorable (2 known properties: “user_id”, “scopes”]) at [Source: N/A; line: -1, column: -1] (through reference chain: com.patreon.resources.User[“social_connections”]->com.patreon.resources.shared.SocialConnections[“discord”]->com.patreon.resources.shared.UserIdObject[“url”])


#25

When attempting to fetch all of the memberships a user has, for example:

https://www.patreon.com/api/oauth2/v2/identity?include=memberships&fields%5Bmember%5D=patron_status,pledge_relationship_start,last_charge_date,last_charge_status

It seems only a UUID type ID is returned? Is there anyway to obtain the ‘normal’ int based creator id? Or is there any way to convert between the 2?

Example return:

        {
            "attributes": {
                "last_charge_date": "2017-01-01T13:00:00+00:00",
                "last_charge_status": "Paid",
                "patron_status": "former_patron",
                "pledge_relationship_start": null
            },
            "id": "bd6d2a2e-1b4f-4122-9180-c94090b7aa47",
            "type": "member"
        },

Thanks


#26

@Robb I haven’t used v2 yet but I think the id value there is the identifier of the membership not the campaign, so there’s no conversion process, rather (I guess) you would request the campaign to be included in the response. From the documentation:

  • 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.

Your example request appears to only request the memberships.


#27

Hey @sam , cheers for the response.

I’ve done some more investigating, and you’re right, that UUID is the membership ID, however it appears when requesting the Campaign resource from the /identity endpoint, it only fetches the auth’d user’s campaign, not the compaign resources of each membership.

Example URL:

https://www.patreon.com/api/oauth2/v2/identity?include=memberships,campaign&fields%5Bmember%5D=patron_status,pledge_relationship_start,last_charge_date,last_charge_status

I’ve found a way to obtain the campaign ID from the membership ID by adding an extra scope (campaigns.members) and using the /members endpoint:

https://www.patreon.com/api/oauth2/v2/members/MEMBERSHIP_UUID?include=campaign

But this would mean an extra API request for every single membership just to obtain the campaign ID. It would make more sense if the campaign ID could be added to the Member resource, or if it could be returned when including Campaign in the /identity endpoint.


#28

Thanks to Nick for the solution:

https://www.patreon.com/api/oauth2/v2/identity?include=memberships.campaign&fields%5Bmember%5D=patron_status

(note the stop rather than the comma from my previous post)


#29

Hi guys! Is there any way to get user cover image and total per month quantity?


#30

I’m trying to implement OAuth on my web app.
but It works only creator’s account.
is there any steps to activate for others account?

// error message from patreon

“errors”: [
    {
        “code”: null,
        “code_name”: “OAuthClientViewForbidden”,
        “detail”: “You do not have permission to view OAuth Client with id [my-client-id].”,
        “id”: “[my-id]”,
        “status”: “403”,
        “title”: “You do not have permission to view this OAuth Client.”
    }
]