Uncaught Ctct\Exceptions\CtctException: Bad Request

Highlighted
Occasional Contributor

Uncaught Ctct\Exceptions\CtctException: Bad Request

Hi,

 

When I am trying to get the contact using the email list id in php, I got some fatal error.

"Fatal error: Uncaught Ctct\Exceptions\CtctException: Bad Request in /html/membersthrive/constantcontact-api/src/Ctct/Services/BaseService.php:100 Stack trace: #0 /html/membersthrive/constantcontact-api/src/Ctct/Services/ContactService.php(67)"

 

My Code is:

$params = array("limit" => 500, "status" => 'ACTIVE');
$listId = '1565890233';
$contacts = $cc->contactService->getContactsFromList($accessToken, $listId, $params); 

 

I don't know what wrong I did. Please help me to fix this issue.

 

Thank you.

3 REPLIES 3
Highlighted
Moderator

Re: Uncaught Ctct\Exceptions\CtctException: Bad Request

Hello,

 

Thank you for reaching out to Constant Contact API Developer Support.

 

Is this the only call you are getting this error with?

 

I'll also be doing some digging on my end to see if I can replicate.

 

Please reply if you have any other questions!

 

Regards,

 

David B.
Tier II API Support Engineer

Highlighted
Moderator

Re: Uncaught Ctct\Exceptions\CtctException: Bad Request

Hello,

 

After reviewing this further I found the issue.

 

When you are using getContactsFromList() any contacts that are returned would be in an ACTIVE status, so it is not expecting to see a STATUS parameter. If you remove that from your $params array, it should function normally.

 

Please give this a try and let me know if you have any other questions.

 

Regards,

 

David B.
Tier II API Support Engineer

Highlighted
Occasional Visitor

Re: Uncaught Ctct\Exceptions\CtctException: Bad Request

Hi @David_B

 

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