cancel
Showing results for 
Search instead for 
Did you mean: 
Constant Contact wants to help you succeed! We’re celebrating our professional service programs on the Constant Contact Community this month and you have a chance to try one of the services for free! Learn more.

Getting Error with the authentication file

Occasional Contributor

Getting Error with the authentication file

Hi,

 

I am using oauth v1.0

But if i include Authentication.php file from wrapper it gives error.

-When i debug i found it's causing due this class in the authentication.php

 

class OAuthException extends Exception{
public function __construct($message, $code = 0, Exception $previous = null){
parent::__construct($message, $code, $previous);
$this->logError($message);
}

private function logError($errorText, $file="error.log"){
$message = "Constant Contact OAuth Exception -- ".date("F j, Y, g:ia")."\n".$errorText."\n";
$message .= "From: ".$this->getFile()." line ".$this->getLine();
error_log($message."\n\n", 3, $file);
}
}

 

After removing this it worked fine. So any idea, help to reach to the conclusion why this error generated. 

I am using below library.

 

https://github.com/constantcontact/ctct_php_library

I know it's deprecated. but till we can't upgrade to new version. we need this compatible with the clients.

3 REPLIES 3
Honored Contributor

Re: Getting Error with the authentication file

Hello,

 

I would be happy to help with investigating the cause of the error you're seeing. In order to provide much more assistance, I would need specific details on the errors such as:

  • Error Message
  • What line of the code is generating the error
  • Error Code (if applicable)

 

If you can provide some of the above information, that should give me enough information to investigate the cause of your error and get you some answers!

 

Sincerely,

Elijah G.
API Support Engineer
Occasional Contributor

Re: Getting Error with the authentication file

Hi,

 

There is not error message and only fix i found is if i comment the particular class, it fix my issue.

class OAuthException extends Exception{

this class i commented in authentication.php

What i think is this class conflicting with any of the class already exiting or using somewhere else too?

Highlighted
Honored Contributor

Re: Getting Error with the authentication file

After a second glace I noticed that you were working with our notably older PHP library for our V1 XML API. If you are working on a new integration rather than maintaining old code, I would strongly suggest working with our V2 API and its related PHP SDK which can be found here: https://github.com/constantcontact/php-sdk

 

In addition to being given access to the newer API, you would also be able to use OAuth 2 intead of OAuth 1. The newer OAuth provides a somewhat simplified process while still providing a secure means to access Constant Contact accounts.

 

As for the older SDK, I can definitely still try to provide some insight, but I would need some sort of information about the error you are seeing. Is there an error type or any sort of way to classify the error?

 

 

Elijah G.
API Support Engineer