Patreon / patreon-php

Interact with the Patreon API via OAuth
Apache License 2.0
145 stars 41 forks source link

Webhooks and automation struggle. #78

Open lukasjuhas opened 4 years ago

lukasjuhas commented 4 years ago

Hi there, I'm struggling with your API/webhooks and I would love some insights/advice on how could I achieve this:

Using your webhooks, I would like to be able to categorise (based on which tier they have selected on my campaign) and display their name on my website. The page is fairly simple: Tier title as a title of the section on the page A comma-separated list of names under that particular category First I'm struggling with your documentation regarding webhooks. It lists information about hooks that are deprecated as shown on (https://www.patreon.com/portal/registration/register-webhooks). There are some other hooks listed, e.g. members:pledge:create but there is no information regarding this in your documentation. This is fine as I can just check what data comes back by printing the response.

Now onto the second bit where I'm able to get the patrons name, but I'm not able to get any information regarding what they pledged to, therefore to categorise them as I wish to do on my website.

I cannot seem to find the user id either particularly with members:pledge:create as that would be useful reference point if the name has changed and they have for example removed their pledge, so I can remove them from the page.

If anyone would have any ideas regarding this or perhaps a better idea of how to approach this differently, It would be much appreciated.

I don't mind to do this differently but I do want to automate this so I don't have to manually edit the page each time there is a new pledge etc.

Thank you!

codebard commented 4 years ago

Are you using these membership related webhooks in your campaign using your own creator token? Or are you trying to get info about non-member users?

Also, ensuring that you are using a v2 client with v2 endpoints is a must - v1 is going to be deprecated in near future, so various features in v2 are not available in v1. You should check and make sure that you are using v2 endpoints and v2 client.

lukasjuhas commented 4 years ago

Are you using these membership related webhooks in your campaign using your own creator token? Or are you trying to get info about non-member users?

Yes, using own creator token.

Also, ensuring that you are using a v2 client with v2 endpoints is a must - v1 is going to be deprecated in near future, so various features in v2 are not available in v1. You should check and make sure that you are using v2 endpoints and v2 client.

Yeah, I did try both, v1 but mainly v2. I had a look in the source code for some other methods/endpoints that I could use but there was not anything that would give me the information I need.

codebard commented 4 years ago

This PHP lib already should have a working webhook example. Have you tried that? Was it not working?