Any Complete Examples of POST a new CONTACT API?

Highlighted
Member

Any Complete Examples of POST a new CONTACT API?

Hello. My first use of API and I need a push in the right direction more than what the web site documentation gives.

 

My application is very simple:

 

I require HTML code (I use PHP or JS executable statements) to add a CONTACT to my CC list from variables that I have already gotten filled in from another form (Chrono Forms integrated with my Joomla).  I don't want another form that the users have to reenter the same data.

 

For a test I did add contacts with the form that CC provided for HTML but I don't want to use that form since the data were already entered into another form; I just want to use the POST of existing data

 

For learning the samples given I copied the JSON request body from

http://developer.constantcontact.com/docs/contacts-api/contacts-collection.html?method=POST

 

then pasted that example into post contact method

https://constantcontact.mashery.com/io-docs

 

Error

Response BodySelect content

[{      "error_key":"json.payload.invalid",      "error_message":"Unable to parse JSON payload."  }]

and yes I did notice that the line numbers from the example had to be removed.

 

Looking for more examples I notice that this sample code page is empty

http://developer.constantcontact.com/libraries/sample-code.html

 

This works perfectly but I want to get rid of the form and formstack since Joomla/ChronoForm already has the data and I don't want to mess with Joomla/ChronoForm integration ,upgrades, etc:

 

<form method="post" action="http://www.formstack.com/forms/index.php">

<input type="hidden" name="form" value="hide my form number" />

<input type="hidden" name="viewkey" value="hide my key" />

<input type="hidden" name="email" value="" />

<input type="hidden" name="custom_field_1" value="" />

<input type="hidden" name="custom_field_2" value="" />

<input type="hidden" name="first_name" value="" />

<input type="submit" />

</form>

 

Is there a complete example?  Everything from

<!DOCTYPE html>

<html>

... through to the end ...

</html>

thanks

4 REPLIES 4
Highlighted
CTCT Employee

Re: Any Complete Examples of POST a new CONTACT API?

Hi,

 

I think your browser has an issue showing the content on the Samples page.  It should look like this, with selectable tabs.

 

Here are our sample signup forms, all hosted in Github with their respective libraries:

 

In PHP

In Ruby

In C#

 

You would need to download the approrpriate library/sdk for those to work.

 

Best Regards,

Shannon W.

API Support Specialist

Highlighted
Member

Re: Any Complete Examples of POST a new CONTACT API?

Hi, how are you? I need your help, do you have some example in ASP Classic, i cant find anywhere, 
I greatly appreciate if you could help me

Highlighted
Honored Contributor

Re: Any Complete Examples of POST a new CONTACT API?

Hello, 

 

Unfortunately, we do not provide any resources for ASP applications due ot the smaller number of developers still using classic ASP, and we do not currently have plans to develop new resources.

Even though we do not have any resources that we provide directly, there is a thread in the developer community where some of our customers have developed a classic ASP sample for adding contacts with our V1 API. You can find that here: 
http://community.constantcontact.com/t5/Getting-Started-with-API-s/Classic-ASP-Sample-Code-Needed/td... 

If you need to create an API key for V1 or access documentation, both of those can be found on the lower part of the page at http://developer.constantcontact.com/

 

Sincerely,

Elijah G.

Tier 2 Support

Elijah G.
API Support Engineer
Highlighted
Moderator

Re: Any Complete Examples of POST a new CONTACT API?

We'll keep an eye on traffic coming in on requests for Classic ASP.  If there is enough interest, we will investigate adding a wrapper for that language.

 

It could be worth creating a new open source project on Github around this and seeing if there are additional developers who want to contribute as well.  We are more than happy to promote any open source projects around our API to the community at large and assist in developing them as best we can.

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

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

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