400 - Bad Request - add contacts activity

SOLVED
Go to solution
Occasional Participant

400 - Bad Request - add contacts activity

I’m trying to create "add contacts" activity. When I post I’m getting “The remote server returned an error: (400) Bad Request.”

Here’s the post request:

activityType=SV_ADD&data=Email+Address%2cFirst+Name%2cLast+Name%0atest1%40test.com%2cJohn%2cDoe&lists=https%3a%2f%2fapi.constantcontact.com%2fws%2fcustomers%2fcname%2flists/Test+2"

Appreciate your help here...

1 ACCEPTED SOLUTION
Employee

Hi David,

 

It looks like your url encoded string is correct with the exception of the list id you are using. List id's are meant to be referenced by their id number, not their name. (ie: /lists/2 vs. /lists/Test List Name). You can get more information about retrieving a listing of your contact lists at Retrieving a Contact List Collection.

 

The error message that your bulk activity is creating for me is:

Error 400: Bad list id URI in request: https://api.constantcontact.com/ws/customers/cname/lists/Test 2

 

I believe if you adjust this to be the corresponding list id that this will resolve your issue. If you have any other questions or concerns please let us know and we'll be happy to help. Thanks.

 

David J

View solution in original post

2 REPLIES 2
Employee

Hi David,

 

It looks like your url encoded string is correct with the exception of the list id you are using. List id's are meant to be referenced by their id number, not their name. (ie: /lists/2 vs. /lists/Test List Name). You can get more information about retrieving a listing of your contact lists at Retrieving a Contact List Collection.

 

The error message that your bulk activity is creating for me is:

Error 400: Bad list id URI in request: https://api.constantcontact.com/ws/customers/cname/lists/Test 2

 

I believe if you adjust this to be the corresponding list id that this will resolve your issue. If you have any other questions or concerns please let us know and we'll be happy to help. Thanks.

 

David J

View solution in original post

Occasional Participant

Worked fine. Thanks for your help.
Developer Portal

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

Visit Page