Using API V2, I’ve ecnountered this confusing moment:
- Redirect to get code
- Send code to backend for access token
- Backend sends access token but since there is no info on user, it can only provide basic info, like email, id, memberships (What are even those?).
But to get user’s tier, I need to send his userId (as per API docs
members/${member_id}?include=address,campaign,user,currently_entitled_tiers
)
However, if I do requests one by one, meaning
- Access token
- Get user info
- Use ID from response
- Send another API call to get pledge/tier
Then all I get is 401, Unauthorized. Could someone explain the easiest way from getting code to acquiring user’s pledge?
EDIT:
My request looks like this:
I managed to scrap some code off of PHP library:
I put &include=currently_entitled_tiers in the end of my request, but nothing is included.
Is there a way to get current tiers using this approach and by NOT having a user’s ID?