cancel
Showing results for 
Search instead for 
Did you mean: 

API for Php version 5.2

Occasional Participant

API for Php version 5.2

Hi,

 

Is there anyone knows where can i find the sample codes/api that is working on php version 5.2? The api that i downloaded from github has the minimum requirements of php 5.3. Anyone, please?

11 REPLIES 11
Honored Contributor

Re: API for Php version 5.2

Hello Mark,

 

Depending on what you need to accomplish, we have a few options available for you. The first option that we have would be to use our V1 API and V1 PHP wrapper which works with any version of PHP5+. However, if you choose to follow this road it is important to note that our V1 API is deprecated and likely to be discontinued in late 2014. If you choose this route, you can find our Docs for V1 and a link to the PHP library here: http://community.constantcontact.com/t5/Documentation/V1-XML-API-Documentation/ba-p/25125

 

Another option that I can offer for a simple task is to provide a sample code of how to use cURL without a specific wrapper to communicate with the API for things such as adding a contact.

 

Please let me know what you're interested in, and I will be happy to provide some resources!

 

Sincerely,

Elijah G.

API Support Specialist

Elijah G.
API Support Engineer
Highlighted
Occasional Participant

Re: API for Php version 5.2

Hi Elijah_G,

 

Thank you so much for your response. I was somehow getting hope to complete this task. 

I would prefer the 2nd option, sample working code of how to use CURL without a specific wrapper to communicate with API. Do you think it would work on creating a simple newsletter and removing contact from contact list?

Occasional Participant

Re: API for Php version 5.2

Is there anyone knows a solution for this?

Moderator

Re: API for Php version 5.2

We will be able to post a cURL example later today for you.  It's important to note that PHP version 5.2 is no longer supported and is considered an insecure version of PHP with no new security fixes being released (see version support level here: http://en.wikipedia.org/wiki/PHP).  Generally, we recommend that you make sure you are upgrading your PHP versions to the latest supported versions to keep up with security updates which is why we now support PHP 5.3 (the lowest actively supported version of PHP).

 

Update: I noticed that 5.3 is now in a security fix only support state now.  The wrapper works fully in 5.4 and 5.5, both of which are fully supported for bug and security fixes. 

Dave Berard
Senior Product Manager, Constant Contact
Honored Contributor

Re: API for Php version 5.2

Hello Mark,

 

Here's the sample I mentioned: https://github.com/kramerg/ctct_php_sample

 

This is a very basic sample and shows the concept of using a few simple API calls. For detailed information about the API endpoints and what information is required to use them, you can read more here: http://developer.constantcontact.com/docs/developer-guides/api-documentation-index.html

 

If you have questions about how to use pieces of our API, the docs are a great place to start. If you get stuck, please feel free to post here in the forums for assistance!

 

Sincerely,

Elijah G.

API Support Specialist

Elijah G.
API Support Engineer
Occasional Participant

Re: API for Php version 5.2

Thank you for the example. May I know what does this error mean {"curl_error":"Error 0 "} ?

I got that error on MakeRequest function

Moderator

Re: API for Php version 5.2

Error 0 means the request is successful and to proceed.  You can see the full list of cURL errors here: http://curl.haxx.se/libcurl/c/libcurl-errors.html

Dave Berard
Senior Product Manager, Constant Contact
Occasional Participant

Re: API for Php version 5.2

Thank you for that. I am sorry for having many questions, i am not quite familiar with the structure.

Do you have a guide on how to create a newsletter in your user interface?

Honored Contributor

Re: API for Php version 5.2

Hello,

 

For information about creating a campaign through our UI, you can find that here: http://knowledgebase.constantcontact.com/articles/KnowledgeBase/5557-create-an-email-campaign

 

Also it is worth mentioning that for questions that are not related to our APIs you can contact our general support team who may be able to respond to your inquiries in a more timely manner. You can find information on how to contact them listed here: https://ui.constantcontact.com/support/index.jsp

 

Sincerely,

Elijah G.

API Support Specialist

Elijah G.
API Support Engineer