After moving from Linux to Windows, script calls Error 50:Unauthorized

Hello all,

i wrote a script to update the CampaignMonitor-Newsletter-Receivers with our address database. Until now, it runs smoothly on Linux using Python 2.7.5.

We are now moving everything to a Windows SBS server. After installing Python there with all needed plugins, i tried to run the script, but got only this error, using the same code as on Linux.

"Unauthorized: The CreateSend API responded with the following error - 50: Must supply a valid HTTP Basic Authorization header"

I then experimented a bit and changed the line

CreateSend.api_key = my_api_key
cs = CreateSend()
clients = cs.clients()

to

cs = CreateSend({'api_key': CS_api_key})
clients = cs.clients()

which resulted in a partial solution. I am now able to get all the client() information, but as soon as i try to call

cl = Client(my_client_id)
cl.lists()

i run into the Unauthorized error again, this time without being able to circumvent it.

Is there anything i'm missing, which is relevant only on the Windows platform?

Best regards,
Martin

roshodgekiss roshodgekiss, 3 years ago

Hi there Martin, this is very unusual - luckily, we've got two previous threads that may help you:

https://www.campaignmonitor.com/forums/topic/5711/must-supply-a-valid-http-basic-authorization-header-classic-asp/
https://github.com/campaignmonitor/createsend-php/issues/15

If reading through these doesn't help solve the issue, kindly contact our team with details and we'll take a look. Sorry for the trouble!


Get in touch with us on Twitter: http://twitter.com/campaignmonitor
We're also on Facebook: http://facebook.com/campaignmonitor

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098