cancel
Showing results for 
Search instead for 
Did you mean: 
Constant Contact wants to help you succeed! We’re celebrating our professional service programs on the Constant Contact Community this month and you have a chance to try one of the services for free! Learn more.

Error trying to update contact

Highlighted
Occasional Participant

Error trying to update contact

Using the endpoint PUT: https://api.constantcontact.com/v2/contacts/{contactId}, I'm getting a user.privilege.forbidden error. I'm authenticated as the account owner, who can update contacts via the web interface. Is there some other permission I need to have updated on the account to be able to update a contact via the API?

 

Specifically, I'm getting a contact via a GET request, then changing the status property to REMOVED and trying to update the contact via a PUT. (So the contact *should* be a valid contact.)

Tags (3)
8 REPLIES 8
Moderator

Re: Error trying to update contact

Hello,

Thank you for reaching out to Constant Contact API Support.

The STATUS field is read only, so you are seeing an error because you cannot make that change this way. If you are simply trying to remove the contact from all lists, the method to do this is to instead do a PUT to the Contact ID with an empty list array/object. This will remove the contact from the account as if you deleted the contact within the Constant Contact website.

Please also note, in order for you to be able to remove all lists from a contact, the action_by will need to be Action_by_Owner. If you attempt to do this as Action_by_Visitor the PUT will fail as a contact removing themselves from all lists should be done as an unsubscribe.

Let me know if you have any other questions and I'll be happy to help in any way I can!

Sincerely,
David B.
API Support Specialist

Occasional Participant

Re: Error trying to update contact

I've tried a couple of ways of using the PUT method to update the contact (using an object with the id and lists properties, and using an object with just the lists property), but I keep getting the same user.privilege.forbidden error.

 

Here's the information I'm logging:

 

[05-Jan-2017 14:05:20 UTC] Studio27\ConstantContact\ConstantContact::removeContact : Contact ID (1279116360)
[05-Jan-2017 14:05:20 UTC] Studio27\ConstantContact\ConstantContact::post : URL (https://api.constantcontact.com/v2/contacts?api_key=***HIDDEN***&action_by=ACTION_BY_OWNER&contactId...)
[05-Jan-2017 14:05:20 UTC] Studio27\ConstantContact\ConstantContact::post : Headers
[05-Jan-2017 14:05:20 UTC] Array
(
[Authorization] => Bearer ***HIDDEN***
[Content-Type] => application/json
)

[05-Jan-2017 14:05:20 UTC] Studio27\ConstantContact\ConstantContact::post : Body ({"id":"1279116360","lists":[]})
[05-Jan-2017 14:05:21 UTC] Studio27\ConstantContact\ConstantContact::post : Response ([{"error_key":"user.privilege.forbidden","error_message":"You don't have permission to perform this action; please see your account owner."}])

Moderator

Re: Error trying to update contact

Hello,

 

There is one other possibility that could be stopping this and that is if the contact you are trying to modify is a "confirmed" contact. If the Constant Contact account has had Confirmed Opt-in turned on then those confirmed contacts can only have their list subscriptions altered by the contact themselves.

 

If you do a GET on the contact it should show if they are "confirmed":"true/false". If this is set to true then that is why you cannot alter their lists. If this is set to false then I would suggest emailing us at webservices@constantcontact.com with all the details such as account username, email address, and API key. That way we can look in to this deeper while keeping your data private.


Regards,
Jimmy D.
Tier II API Support Engineer
Occasional Participant

Re: Error trying to update contact

The confirmed property is empty, neither true nor false. Could that also cause the problem?

Solution Provider

Re: Error trying to update contact

Hi,

I have a case similar to this, but the contact has the field 'confirmed' as false.

 

The weird thing is that getting the contact via the API it returns status OPTOUT and an empty list of lists. However when I access the same contact via the web UI it shows the lists that I just updated and the status is "Permission to send".

 

What could be happening?

Moderator

Re: Error trying to update contact

Hi @PH06611,

 

In your case it sounds like you might be dealing with a duplicate contact profile. I wouldn't be able to say for certain without digging in to your account and the contact a bit more and that information is best kept private.

 

If you would please email us at webservices@constantcontact.com and provide the Constant Contact username you are adding the contact to as well as the email address and the API key you are using.


Regards,
Jimmy D.
Tier II API Support Engineer

Re: Error trying to update contact

I try to update the the account to be active and keep getting :

 

Array
(
[response] => [{"error_key":"email","error_message":"billing.customer.email.required"}]
[http_code] => 400
)

the account is trial and I send :

 "plan_type": 2,

"billing_day_of_month": 20

}

but still getting the error above

Moderator

Re: Error trying to update contact

Hi @QualityAssurance2,

 

This error generally occurs when the account does not have a verified email address set to receive billing information. You need to ensure you have a verified email address on the account and also ensure the billing section is set with a valid email address. This is generally done by logging in to your Constant Contact account and going to the My Account area by clicking in the upper right.


Regards,
Jimmy D.
Tier II API Support Engineer