API Fields Parameter for Pledge Event?

Hello! As part of the multi-currency change rolling out, I am trying to update my site to use API v2 and access PledgeEvent data.

I can’t figure out what I need to pass in to fields[] for it to see the details of a pledge event.

It seems like fields[pledge_event] should work based on the resource name in the docs, but instead I get an error.

Invalid parameter for ‘fields[pledge_event]’ on type member: [None].

Can you tell me the right thing to put in fields? I tried a bunch of variations of ‘event’ and ‘history’ but couldn’t figure it out, and there are no examples in the docs.

Here is the incorrect URL I am trying currently:

https://www.patreon.com/api/oauth2/v2/campaigns/701009/members?include=currently_entitled_tiers,user,pledge_history&fields%5Bmember%5D=full_name,is_follower,last_charge_date,last_charge_status,lifetime_support_cents,currently_entitled_amount_cents,patron_status&fields%5Btier%5D=amount_cents,created_at,description,discord_role_ids,edited_at,patron_count,published,published_at,requires_shipping&fields%5Bpledge_event%5D=type,date,payment_status,tier_title,tier_id,amount_cents,currenc…

Thank you!

1 Like

The pledge_history you included in includes already brings the pledge_history relationship for the member resource that is returned from members endpoint. But apparently it does not include the specific fields that you want at the end of your query. There doesnt seem to be a way to get the fields of the pledge_event resource which is member resource’s relationship in /campaigns/…/members call in one go.

However iterating the members in the return from /campaigns/…/members and calling the member endpoint with the below call seems to bring the pledge event fields you want in [included] section of the return for each member:

members/MEMBERID?include=pledge_history

If anyone else knows a better solution that can get the pledge_event details in /campaigns/members call, that would be more efficient of course.

1 Like

Does anyone know the endpoint and the syntax for the POST command to create posts ?

Thanks to CodeBard for providing a potential fallback solution and some additional ideas over Discord.

This strategy will work, but the downside is it will also result in us having to spam the API pretty considerably (we poll every thirty minutes, and have 1000+ linked patron accounts) and won’t scale very well as we gain more patrons. There’s definitely ways we can optimize that, but it’s still a very clunky workaround for a problem than a Patreon dev support engineer could illuminate in five minutes (unless this is an actual bug). So I’m still hoping for a more ideal solution here.

Claire - I feel your question would be better as a new thread, as it doesn’t relate to the question in this one.

1 Like

Completely agree. But I am a new user here and I don’t think they let me start a new thread.

As far as i know creating posts at Patreon is not supported at the api.