400 - Bad Request - add contacts activity

SOLVED
Highlighted
Occasional Contributor

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

Accepted Solutions
Highlighted
CTCT Employee

Re: 400 - Bad Request - add contacts activity

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
Highlighted
CTCT Employee

Re: 400 - Bad Request - add contacts activity

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

Highlighted
Occasional Contributor

Re: 400 - Bad Request - add contacts activity

Worked fine. Thanks for your help.
Developer Portal

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

Visit Page

Constant Contact Would Like To Hear From You!

We want to hear from customers like you about your favorite features and how they have helped your business or organization. Tell us by answering a few questions in...

Read More
Featured