The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

Trying to post to activities

Highlighted
New Member

Trying to post to activities

Please help!  I'm using the "https://api.constantcontact.com/ws/customers/kznmba/activities" with the post method (from a win32 application).


I suspect there is something wrong in my post string (basically just copied from the example), which is:


activityType=SV_ADD


&data=Email+Address%2CFirst+Name%2CLast+Name%0A


test3%40example.com%2C+Fred%2C+Test%0A


test4%40example.com%2C+Gary%2C+Test%0A


&lists=http%3A%2F%2Fapi.constantcontact.com%2Fws%2Fcustomers%2Fkznmba%2Flists%2F27

 


 


This is my debug code from my post.


 


02:19:11 PM    POST /ws/customers/kznmba/activities HTTP/1.0    

02:19:11 PM    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*    

02:19:11 PM    Accept-Language: en    

02:19:11 PM    Authorization: Basic .............removed......................

02:19:11 PM         

02:19:11 PM    Content-Type: application/x-www-form-urlencoded    

02:19:11 PM    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)    

02:19:11 PM    Host: api.constantcontact.com    

02:19:11 PM    Pragma: No-Cache    

02:19:11 PM    Cache-Control: No-Cache    

02:19:11 PM         

02:19:11 PM    activityType=SV_ADD&data=Email+Address%2CFirst+Name%2CLast+Name%0Atest3%40example.com%2C+Fred%2C+Test%0Atest4%40example.com%2C+Gary%2C+Test%0A&lists=http%3A%2F%2Fapi.constantcontact.com%2Fws%2Fcustomers%2Fkznmba%2Flists%2F27    

 


 


Constant contact server reply details:


02:19:12 PM    Fault Name: HttpRequestReceiveError   

02:19:12 PM    Error Type: Default   

02:19:12 PM    Description: Http request received failed   

02:19:12 PM    Service: null   

02:19:12 PM    Endpoint: null   

02:19:12 PM    Operation (Client):   


 


What am I doing wrong?


Regards


John

2 REPLIES 2
Highlighted
Employee

Re: Bulk Activity error

Hello John,



I did a post to our Bulk Activities URI with your data and it successfully passed on my end. Is it possible for you to send your actual code to the webservices support team.



We should be able to help you once we take a better look at the code.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Highlighted
New Member

The server response was a 411

The server response was a 411 (client side problem).


Today Im going to switch to using 'multipart/form-data' as that seems a better option to 'application/x-www-form-urlencoded', but I may well encounter the same problem.


I'm using a 3rd party library so there aint much to see in my code.


I will also use a debugging tool - restclient was suggested.


Thanks


John

Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured