I updated your post to hide your username, password and API Key. Please change your password ASAP for security purposes as other people may have seen this and now have access to your account.
Regarding the 401 error, it looks like the problem is that while you're setting the login information for your account, the request endpoint seems to be set to our sample code account, joesflowers. You would correctly get a 401 error in this scenario because you don't have access to joesflowers account.
Dave Berard Senior Product Manager, Constant Contact