Where is the Discord ID in the Patreon Webhook request?

Hey there, so I am trying to create a Discord bot that has a patreon webhook. I want my webhook to post a message in some channel on pledge:create and :pledge:delete. So far, so good. My code works up to there.

However, I want to be able to ping the user’s discord account, if they have it linked. I don’t really want to include real names, as that might evade privacy. In that case, just using the webhook, how can I get the user’s discord ID? The webhook returns a JSON, and maybe its something like: data[attributes][social_connections][discord_id]? I made a test payment to see where it is in the JSON, but I was unable to find it. Any help is much appreciated!

You can give a try to this one:

https://docs.patreon.com/#fetching-a-patron-39-s-profile-info

Hmm, it seems simple enough to just make that request. Is there any way to avoid using the API and just get it through the webhook?

If the webhook is not already providing it, no. As an alternative you can use a singular call to get both identity and patronage info like WP plugin is using:

You should be able to request additional info about the patron profile via includes.

Awesome, thank you for all of your help!

1 Like

Actually, for anyone looking for the answer, I found where the Discord ID is in the webhook!

request → data → included[0] → attributes → discord_id

1 Like