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.

API - subscribing back an e-mail address

SOLVED
Go to solution
Highlighted
Occasional Advisor

API - subscribing back an e-mail address

Hi, I'm confused about options for changing contact status from OPTOUT to ACTIVE via API. I do understand that it must be triggered by the user himself.

 

Your documentation on Opting contacts back in seems to say that if I set action_by to ACTION_BY_VISITOR then I should be able to do that with the PUT method. However, when I look at documentation for Individual Contacts / PUT the description for both contact status and e-mail address status says "(Read Only)".

 

Also, when I use your Mashery API Tester/debugger (indispensable, by the way), I get an error when I try anyway. I did use ACTION_BY_VISITOR.

 

Request:

{
    "id": "1416757038",
    "status": "ACTIVE",
    "lists": [],
    "email_addresses": [
    {
        "status": "ACTIVE",
        "email_address": "whatever@email.com"
    }
    ],
    "first_name": "Jane",
    "last_name": "Doe"
}

 

Response Status:
  400 Bad Request

Response Headers:
  Cache-Control: private, no-cache, no-store, max-age=0, must-revalidate, no-cache="Set-Cookie"
  Content-Type: application/json
  Date: Wed, 10 Sep 2014 22:07:10 GMT
  Pragma: no-cache
  Server: Apache
  Vary: Accept-Encoding,User-Agent
  X-Mashery-Responder: prod-j-worker-us-east-1e-49.mashery.com
  X-Powered-By:
  Content-Length: 136
  Connection: keep-alive


Response Body
  [{
      "error_key": "query.param.action_by.is_not_valid_for.delete",
      "error_message": "The action_by value is not valid for contact deletion."
  }]

 

I don't understand what the error message means, or where I could find its meaning. Any idea?

 

Thanks

Petr

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Occasional Advisor

Re: API - subscribing back an e-mail address

The issue has been resolved thanks to Shannon from Webservices@constantcontact.com.

 

My error was that I didn't add the contact to any list - i.e. the lists value was an empty array.

 

I missed that the chapter Opting contacts back in mentions that "...they must be added to a contact list when adding them to the contact collection."

View solution in original post

1 REPLY 1
Highlighted
Occasional Advisor

Re: API - subscribing back an e-mail address

The issue has been resolved thanks to Shannon from Webservices@constantcontact.com.

 

My error was that I didn't add the contact to any list - i.e. the lists value was an empty array.

 

I missed that the chapter Opting contacts back in mentions that "...they must be added to a contact list when adding them to the contact collection."

View solution in original post

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