Reputation: 1
I'm trying to parse through every patron listed in my Patreon campaign. I've been taking code right off of the Patron API to do so, but I'm still getting an error. This is what I have
import os
import patreon
access_token = os.environ.get('ACCESS_KEY_PATREON') # patreon access token, saved as an environment variable
api_client = patreon.API(access_token) # set up patreon client
campaign_response = api_client.fetch_campaign()
campaign_id = campaign_response.data()[0].id()
I'm getting this error:
campaign_id = campaign_response.data()[0]
AttributeError: 'dict' object has no attribute 'data'
Since this is right off the documentation, I have no idea what could be wrong. I've imported the Patreon library, but maybe I didn't set everything up?
Upvotes: 0
Views: 172