Closed BrisbanePom closed 3 years ago
I am trying to connect to my client / campaign using the Python Wrapper and an API connection.
I apply the following code:
from createsend import * #Connect via API key cs = CreateSend({'api_key': '123<api-redacted>'}) clients = cs.clients() auth = { 'api_key': '123<api-redacted>' } #clients. for cl in clients: print(cl.Name) cl = Client(cl.ClientID,auth) #client = Client(cl.ClientID) for cm in cl.campaigns(): print(" - %s" % cm.Subject)
But get the following error message:
Unauthorized: The CreateSend API responded with the following error - 50: Must supply a valid HTTP Basic Authorization header
What do I need to pass to the client to provide a valid authorization header? The documentation explains how to do this with OAuth, but does not show the required code when using the API: https://github.com/campaignmonitor/createsend-python/blob/master/README.md
I'm having the same issue, is anyone working on that wrapper code?
@Trandel the API documentation includes details on where to get the API Key from.
I am trying to connect to my client / campaign using the Python Wrapper and an API connection.
I apply the following code:
But get the following error message:
What do I need to pass to the client to provide a valid authorization header? The documentation explains how to do this with OAuth, but does not show the required code when using the API: https://github.com/campaignmonitor/createsend-python/blob/master/README.md