We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

ACTION_BY_CONTACT not working?

jdown
Occasional Participant

ACTION_BY_CONTACT not working?

Below is the XML i'm PUTing to update a contact to be included in contact lists. The lists are included in the account owners sign up form and everything is working as expected...



Apart from the OptInSource tag. I'm setting this to ACTION_BY_CONTACT because users are can opt themselves back in to the lists using the a web form. Even though I'm setting the tag to ACTION_BY_CONTACT the emails always appear in the lists as 'Added by Site owner'. New contacts are shown as 'Added by Contact'.



Can you offer some advice please? Is it impossible to add ACTION_BY_CONTACT updates to contacts through the API? As you can see I've tried adding the OptInSource in the ContactList tags also but with no joy.



Many thanks for any help you can provide.



JD




<entry xmlns="http://www.w3.org/2005/Atom">
<id>http://api.constantcontact.com/ws/customers//contacts/892</id>
<title type="text">Contact: </title>
<updated>2008-04-25T19:29:06.096Z</updated>
<author> </author>
<content type="application/vnd.ctct+xml">
<Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers//contacts/892">
<EmailAddress></EmailAddress>
<OptInSource>ACTION_BY_CONTACT</OptInSource>
<ContactLists>
<ContactList id="http://api.constantcontact.com/ws/customers//lists/25">
<link xmlns="http://www.w3.org/2005/Atom" href="http://api.constantcontact.com/ws/customers//lists/25" rel="self"></link>
<OptInSource>ACTION_BY_CONTACT</OptInSource>
</ContactList>
<ContactList id="http://api.constantcontact.com/ws/customers//lists/24">
<link xmlns="http://www.w3.org/2005/Atom" href="http://api.constantcontact.com/ws/customers//lists/24" rel="self"></link>
<OptInSource>ACTION_BY_CONTACT</OptInSource>
</ContactList>
</ContactLists>
</Contact>
</content>
</entry>
22 REPLIES 22
CC_TomM
Frequent Participant

I believe you are doing this correctly. I will look into this further to find out what you should be able to do.
Tom M
Group Product Manager – Content Editing
Constant Contact
jdown
Occasional Participant

Great, thanks Tom

James
CC_TomM
Frequent Participant

James
This API resource is not working as expected. We are looking into the issue now. It appears that the OptInSource works appropriately on Contact Creation (POST), but does support the same options as the application UI on Contact Updates (PUT). I will post on this thread when I have an update.

Thanks,
Tom
Tom M
Group Product Manager – Content Editing
Constant Contact
jdown
Occasional Participant

Hi Tom,

Any news on this problem? is there and ETA for the fix to be in place at all?

Many thanks,

James
CC_TomM
Frequent Participant

We are reviewing the issue and refining both what actions should be supported via the API and the possible implications on the Contacts resource (which we are hoping to minimize). I do not expect changes to the behavior of the API in the short term and suggest you consider work arounds for the time being.
Thanks,
Tom M
Group Product Manager – Content Editing
Constant Contact
ASherrick
Regular Participant

When will this be fixed? This is a critical bug for our clients and renders some functionality unusable!

Aaron
askrenes
Regular Participant

This is also a problem for me. Can we get an update, or at least a suggestion for a workaround?
CC_TomM
Frequent Participant

We are working on changes to enable a contact update (PUT) initiated by the Contact (ie. support for a PUT with OptInSource=ACTION_BY_CONTACT). We are not expecting to release changes in this area in the short term.

Until we release changes, I have two suggestions:
1) Use the SiteVisitorAPI to perform the contact change. This API allows adds and changes "by contact".

2) Use the Contacts Resource (as I believe you are doing now) and use ACTION_BY_CUSTOMER to perform contact changes.

Thanks,
Tom M
Group Product Manager – Content Editing
Constant Contact
CC_TomM
Frequent Participant

The Contacts Resource now supports opting a contact back in by using the 'ACTION_BY_CONTACT' OptInSource. Note that our Constant Contact policy forbids re-subscribing contacts without their explicit permission. This flag MUST ONLY BE USED WHEN THE CONTACT THEMSELF is initiating the action (ie. on a subscriber based "re-optin") page.
Tom M
Group Product Manager – Content Editing
Constant Contact
askrenes
Regular Participant

ACTION_BY_CONTACT is not working - it returns a (400) Bad Request error.

When I use ACTION_BY_CUSTOMER, I get "(403) Forbidden.", which essentially verifies that the code works and that the contact has "opted out"

Then when I use ACTION_BY_CUSTOMER (same code, same xml), I get "(400) Bad Request."

Here's the xml:

&lt;entry xmlns="http://www.w3.org/2005/Atom"&gt;&lt;id&gt;http://api.constantcontact.com/ws/customers/myusername/contacts/43&lt;/id&gt;&lt;title type="text"&gt;Contact: askrenes@example.com&lt;/title&gt;&lt;updated&gt;2008-07-23T14:21:06.407Z&lt;/updated&gt;&lt;author&gt;&lt;/author&gt;&lt;content type="application/vnd.ctct+xml"&gt;&lt;Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/myusername/contacts/43"&gt;&lt;EmailAddress&gt;askrenes@example.com&lt;/EmailAddress&gt;&lt;FirstName&gt;Andy&lt;/FirstName&gt;&lt;LastName&gt;Test&lt;/LastName&gt;&lt;CompanyName&gt;Acme Inc.&lt;/CompanyName&gt;&lt;CustomField1&gt;&lt;/CustomField1&gt;&lt;OptInSource&gt;ACTION_BY_CONTACT&lt;/OptInSource&gt;&lt;ContactLists&gt;&lt;ContactList id="http://api.constantcontact.com/ws/customers/myusername/lists/7" /&gt;&lt;ContactList id="http://api.constantcontact.com/ws/customers/myusername/lists/12" /&gt;&lt;/ContactLists&gt;&lt;/Contact&gt;&lt;/content&gt;&lt;/entry&gt;
cedub
Participant

I need this option. I just expected this option would be available and had I known this wasn't, I'd have gone with a different service (not to mention the documentation for the entire API leaves much to be desired). Would love some support on this issue.
kriegerman
Participant

Any Update as I am having the same issue.
CC_TomM
Frequent Participant

We are actively looking into the "Resubscribe" issue. Until we identify and implement a change, it is possible to use a verb from our deprecated AddSiteVisitor API to perform this action. The implication is taking this route is that your code would need to be modified at some point in the future. If you would like to pursue that option, please send an email to webservices at constantcontact.com and we can send documentation.

Thanks,
Tom M
Group Product Manager – Content Editing
Constant Contact
coolcontact
Participant

I'm waiting to hear back from webservices at constantcontact.com. Any chance you can post the documentation on this thread?
tmignosa_external
Occasional Participant

I have temporarily attached the documentation to this page. You need to be logged in to this developer web site to see the attachment. It is listed at the bottom of that page.



Thanks,
mimeya
Occasional Participant

Has this been resolved?


Also what happened to the workaround docs at the link above: http://developer.constantcontact.com/doc/siteVisitorAPI


Thanks,


mimeya


 

David_J
Employee

The documentation posted at http://developer.constantcontact.com/doc/siteVisitorAPI is still active, but you would need to be logged into the site to view this documentation. Please note as the documentation states, that while the Site Visitor API still functions, it is being deprecated shortly. We would strongly recommend that you take a look at using our Rest API which has increased functionality and is the preferred method for future development. If you are still experiencing issues accessing the documentation above after logging into this site with your developer login, please let us know. Thanks.

David J

DaveBerard
Moderator

It is worth noting, this issue has been resolved and the workaround is not needed.  Contacts added to the Do Not Mail list can again be added back into an account with the REST API.  Please note: it is a violation of the Constant Contact Terms and Conditions and the Constant Contact API Terms and Conditions to add back any contact who has not explicitely taken action to be added back.  Please see our T&C for more detailed information regarding this.

Dave Berard
Senior Product Manager, Constant Contact
mimeya
Occasional Participant

DaveBerard
Moderator

Sorry for the confusion with that link.  Our siteVisitorAPI is a depricated API feature which is no longer given out to any new or existing customers.  Our REST API has both replaced all the functionality of that API and augmented it with more control, features and usability.  The documentation link is no longer available to any of our customers going forward and this API will, at some point, be completely phased out requiring anyone who is currently implementing it to change over to our REST API.  That date is not determined yet and will be given plenty of lead time for adjustments when it is determined.


 


Regarding the issues with PHP servers and cURL, we have done extensive testing in numberous hosting, OS and PHP/cURL version environments and have as yet been unable to replicate any of these problems in these environments.  Many of our testing environments are outside of Constant Contact using popular hosting companies to ensure that our sample code works in these environments.


 


From all indications of the issues, the problem does appear to be around server settings rather than code issues.  Since many customers are able to use it in local test environments or prior to updating server configurations or packages, this is a definitive indicator that the issue is caused by said server configurations or packages and not by the code itself.  We are happy to look into these issues as best we can, however server environments are often very difficult to troubleshoot.  Please send any additional information you have to the email address Dave J mentioned in his above post if you would like us to assist you further.  It will be best to have more information about your server and OS configurations included as well to see if we can find an issue with the configuration.

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

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

Visit Page