cancel
Showing results for 
Search instead for 
Did you mean: 

Updating Contact from PHP

Valued Developer

re: OptInSource and "List Does Not Exist" Issue

While I see the OptInSource for a specific List (List 9), I do not see the <OptInSource> tag for the Contact. You need to have this tag in the Contact (not just the Contact List), so your XML includes something like this:

...
<CustomField15></CustomField15>
<OptInSource>ACTION_BY_CUSTOMER</OptInSource>
<ContactLists>
<ContactList id="http://api.constantcontact.com/ws/customers/{USERNAME}/lists/9">
<link xmlns="http://www.w3.org/2005/Atom" href="http://api.constantcontact.com/ws/customers/{USERNAME}/lists/9" rel="self"></link>
<OptInSource&gtACTION_BY_CUSTOMER</OptInSource>
...

Please let me know if this works.
Tom M
Group Product Manager – Content Editing
Constant Contact
Valued Developer

re: Example of PUTing Code (PHP)

Short Put example posted in the Getting Started/Samples Forum here.
Tom M
Group Product Manager – Content Editing
Constant Contact
Valued Developer

re: Code and Output - PUT example, PHP.

Short Put example posted in the Getting Started/Samples Forum here.
Tom M
Group Product Manager – Content Editing
Constant Contact
Occasional Participant

troubles with REST API

when I say my output, I mean this:

http://www.jetboystudio.com/downloads/cc/output.txt

And the <OptInSource>ACTION_BY_CUSTOMER</OptInSource> tag is on line 888.

As far as I can tell, I'm feeding the REST server the right XML. Do you see anything missing from the code or output?

I will experiment with your demo code, and get back to you.
Valued Developer

re: Troubles with Rest API

Hi konsumer,

If List 9 is not included on your sign-up form, then you need a Second OptInSource tag. This tag must be outside the <ContactLists&GT; ta; tag, Ie.:
...

<CustomField15></CustomField15>
<ContactLists>
<ContactList id="http://api.constantcontact.com/ws/customers/{USERNAME}/lists/9">
<link xmlns="http://www.w3.org/2005/Atom" href="http://api.constantcontact.com/ws/customers/{USERNAME}/lists/9" rel="self"></link>
<OptInSource>ACTION_BY_CUSTOMER</OptInSource>
<OptInTime>2008-11-01T00:34:28.931Z</OptInTime>
</ContactList>
</ContactLists>

(I don't understand the error message you are getting, but in any case you may need this second OptInSource tag).
Tom
Tom M
Group Product Manager – Content Editing
Constant Contact