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.

query.param.action_by.does_not_match.opt_in_source:action_by and opt_in_source must be consistent

SOLVED
Go to solution
Highlighted
Occasional Contributor

query.param.action_by.does_not_match.opt_in_source:action_by and opt_in_source must be consistent

Sorry, me again! :)

Thanks to David_B's help using the SDK I can now create contacts via API, but when the Marketing people look at the list, all the new contacts created by our website users are marked as 'Implied permission', we want them marked as 'Express consent'.

 

To do this I thought I could create them as ACTION_BY_VISITOR rather than ACTION_BY_OWNER as shown below:

 

EmailAddress email = new EmailAddress()
{
    EmailAddr = contactRec.Email,
    Status = "ACTIVE",
    ConfirmStatus = "NO_CONFIRMATION_REQUIRED",
    OptInSource = "ACTION_BY_VISITOR",
    OptInDate = DateTime.UtcNow.ToString("o")
};

 

However when calling contactService.AddContact() I get the message:

"query.param.action_by.does_not_match.opt_in_source:action_by and opt_in_source must be consistent when creating a contact."

 

Note I've also tried setting 'Source' in the contact record to ACTION_BY_VISITOR

 

Is it possible to create records as ACTION_BY_VISITOR? I note from another topic Change Consent that it's not possible to change the action type via the API, but can they be created that way?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Moderator

Re: query.param.action_by.does_not_match.opt_in_source:action_by and opt_in_source must be consisten

Hello,

 

 

When an integration creates a contact, it can do so with the action_by parameter set as either action_by_visitor or action_by_owner; which method used determines if a contact is making the change, and thus if they are added as express or implied. An integration should only submit contacts as "action_by_visitor" if a contact themselves is making the change through something like a signup form on a website. "Action_by_owner" should be used any time that the account owner is creating or updating contacts to make sure that previously unsubscribed contacts are not re-subscribed without their permission.

 

The source is returned when you get a contact, but not something you need when creating one; I might suggest not passing that through.

 

ACTION_BY is set as a parameter and does not go in the JSON data; it is used as a URL parameter exactly the same way that your API Key is used.

 

 

I know you're using our C# SDK and the way you set ACTION_BY is by passing a boolean with your call i.e.

public Contact AddContact(
	string accessToken,
	string apiKey,
	Contact contact,
	bool actionByVisitor
)

e.g.

// Passes as action_by_owner
contactService.AddContact(contact, false);

// Passes as action_by_visitor
contactService.AddContact(contact, true);

 

Please let me know if you have any questions!

 

Regards,
David B.
Tier II API Support Engineer

 

View solution in original post

2 REPLIES 2
Highlighted
Moderator

Re: query.param.action_by.does_not_match.opt_in_source:action_by and opt_in_source must be consisten

Hello,

 

 

When an integration creates a contact, it can do so with the action_by parameter set as either action_by_visitor or action_by_owner; which method used determines if a contact is making the change, and thus if they are added as express or implied. An integration should only submit contacts as "action_by_visitor" if a contact themselves is making the change through something like a signup form on a website. "Action_by_owner" should be used any time that the account owner is creating or updating contacts to make sure that previously unsubscribed contacts are not re-subscribed without their permission.

 

The source is returned when you get a contact, but not something you need when creating one; I might suggest not passing that through.

 

ACTION_BY is set as a parameter and does not go in the JSON data; it is used as a URL parameter exactly the same way that your API Key is used.

 

 

I know you're using our C# SDK and the way you set ACTION_BY is by passing a boolean with your call i.e.

public Contact AddContact(
	string accessToken,
	string apiKey,
	Contact contact,
	bool actionByVisitor
)

e.g.

// Passes as action_by_owner
contactService.AddContact(contact, false);

// Passes as action_by_visitor
contactService.AddContact(contact, true);

 

Please let me know if you have any questions!

 

Regards,
David B.
Tier II API Support Engineer

 

View solution in original post

Highlighted
Occasional Contributor

Re: query.param.action_by.does_not_match.opt_in_source:action_by and opt_in_source must be consisten

Once again, thank you. That works fine. I'll mark your answer as the solution.

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