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()


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)

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,

roshodgekiss roshodgekiss, 3 years ago

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

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:
We're also on Facebook:

200,000 companies around the world can't be wrong.

From Australia to Zimbabwe, and everywhere in between, companies count on 
Campaign Monitor for email campaigns that drive real business results.

Get started for free