The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

Put New Contact vs Update Put

Highlighted
Advisor

Put New Contact vs Update Put

What are the differences between the following:

1) XML tags/layout

2. XML tag Content (values of the tags)

 

4 REPLIES 4
Highlighted
Employee

Re: Put New Contact vs Update Put

Hey,

 

You can find the required syntax upon a POST for creating a contact here.  As far as doing the PUT, I suggest to do a GET and update the necessary information. 

 

I hope this helps.

Ryan Davis
Quality Engineer
Highlighted
Advisor

Re: Put New Contact vs Update Put

Sorry, I'm using the phrase Put but it should be "Post", that's true in my other forum posts (no punn intended)

 

Okay, correctt me if I'm wrong the xml that I send with an update and a new record are the same except that the Contact attribute "id" is missing on a new contact?

 

And, the xml is just the Atom ns entry section and CtCt ns Contact (in Content)
Entry xmlns=Atom>....<Content>...<Contact xmlns:ctct [id is omitted0]

 


 

Highlighted
Employee

Re: Put New Contact vs Update Put

Hey,

 

Yes they are the same but it is best to get everything and re-include it as there could be information in other fields and if you do an update with that field missing it will remove it.  Information is not appended upon put, it is replaced.The namespaces are exactly as you mentioned.

Ryan Davis
Quality Engineer
Highlighted
Advisor

Re: Put New Contact vs Update Put

I will be doing a fresh get then post after correlating my data, business rules (which data is the survivor) etc...

 

However the reason I'm asking is that I'm not using any class or xpath operations, I'm using transformations from predefined XSLT docs stored as .xsl files (xml) and eventually in the database, hence why I need to know which tags, attributes and ns's will be returned so I can properly parse or render the correct xml string from xslt.

 

When I get further along, I'll post my sample xml strings of all my expected get & post operations for review.

 

If I'm sucessful, I'll post a link to my xslt and how I did it. I personally prefer it to all the looping & parsing of the xml; in this case your samples have most of the code to do so, but that's not always the case with some implementations.

 

Developer Portal

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

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured