I had this code working perfectly a few days back, but when I tried it again today, it is throwing a ConnectionRefused exception. I am sure the username, password, API key are all correct since I am able to log into the api website using them.
I need to sort this out as soon as possible. Any help shall be appreciated.
UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(cckey+"%"+ccuser, ccpass);
AuthScope authScope = new AuthScope("api.constantcontact.com", 443);
CredentialsProvider credsProvider = new BasicCredentialsProvider();
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("https://api.constantcontact.com/ws/customers/"+ccuser+"/contacts");
StringEntity stringEntity = new StringEntity(xmlString);
HttpResponse httpResponse = httpClient.execute(httppost);
You can post a new message in the Community or find us on Twitter Mon-Fri 8am-8pm ET, Sat 10am-8pm ET, & Sun 10am-6pm ET. We've got real people waiting to help you out. Click below to start a conversation!