Mark, we are facing the following situation:
if someone has previosly unsubscribed from our list and now has re-visited our site and wants to re-subscribe, we get ERROR 403. Where do I add a catch so that if someone is re-subscribing the engine can let them know that they will receive an email?
As of now, the addSubscriber funtion adds the contact successfully or returns the same generic message if they are already registered or if they are currently in the do not mail list, and we want to differentiate this so that people can resubscribe.
The 403 response isn't what I would expect if you are trying to create a contact in an account in which it already exists (which uses a POST request), instead of updating the contact to add the desired list/interest attribute (which uses a PUT request).
Our API servers will return a 409 if you attenmpt to use a POST request using an email address that is already associated with the account (one that has been previously added, even if it is removed). Removed and Do-Not-Mail are not list/interest attributes in our system, but instead are a "status" of a contact. Our system doesn't delete contact-account associations when people unsubscribe, because to comply with U.S. federal anti-spam law (The CAN-SPAM Act), unsubscribing is not just asking to be taken off a list, but is a specific request that you not send the contact additional emails.
The best approach to adding contacts, if you want people to be able to resubscribe using your form, is not to try and use an addSubscriber() function that simply tries to do a POST method request, but instead to do the following:
1) Search for Contact by email address (this does a GET request to get the contact ID for a given email address).
2) If the request in #1 is successful, you then get the contact details (GET request on the contact's ID).
3) Update the details returned from #2 with new data (add contact lists to the contact's details) and then submit an update contact request. For contacts that have unsubscribed, this must be done as an action initiated by the contact, and will result in an Update Profile email being sent to their email address, which they must click a link in, and confirm their interest in recieving your emails on a webform that we host (can edit within the Constant Contact account UI). After they do this, they will be added to the selected list - this is done as a means of confirming that the person making the request to resubscribe is a person in control of the email address being re-subscribed, and that this is not being done with the email address owners knowledge.
4) If the request made in #1 finds no contact, you do an add contact, or addSubscriber type of request (a POST method request) to create the contact.
For step 3, if you wanted to warn someone that they are going to recieve an update profile email and they will need to follow the instructions there to complete resubscription, you would need to check the status in the contact'd details to see if it is "Do Not Mail" and if so, display the appropriate message after they submitted their resubscribe request, and also you would want to make sure that for just that one request, if it is not already done for all your reuqests, that the optInSource in the contact details submitted with the update is set to "ACTION_BY_CONTACT" (request to resubscribe without this for Do Not Mail status contacts will fail.
How you set all of the above up depends on whether you're using one of our wrapper libraries, or sample code packages, some of which do not currently have our most updated wrapper libraries integrated yet.
I hope the above is helpful to you. Let us know if you have more questions. If you need more assistance with the above, you can email email@example.com, and one of our API Support Team may be able to offer a little more directed help.