You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use the API to fetch data from creators I support on Patreon with my own account. I created a client and found my creator access token.
importpatreon,jsonclient_id=" "# My client IDclient_secret=" "# My client secretoauth_client=patreon.OAuth(client_id, client_secret)
tokens= {}
withopen('patreontokens', 'r') astfile: # Creator access and refresh tokens stored in a filetokens=json.loads(tfile.read())
tokens=oauth_client.refresh_token(tokens["refresh_token"]) # Refresh the tokenswithopen('patreontokens', 'w') astfile:
tfile.write(json.dumps(tokens))
creator_access_token=tokens["access_token"]
api_client=patreon.API(access_token)
ident=api_client.get_identity()
print(ident)
I read about a similar issue here which is why I am refreshing the token.
The output of the program is:
{'errors': [{'code': 1, 'code_name': 'Unauthorized', 'detail': "The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.", 'id': 'ca7835a3-90f2-4d1e-aa99-188a9efc5285', 'status': '401', 'title': 'Unauthorized'}]}
I want to use the API to fetch data from creators I support on Patreon with my own account. I created a client and found my creator access token.
I read about a similar issue here which is why I am refreshing the token.
The output of the program is:
I have confirmed by doing print(token) that the refreshed token matches the one given to me at https://www.patreon.com/portal/registration/register-clients
The text was updated successfully, but these errors were encountered: