$contact = $response->results[0]; $contact->addList("1"); if(isset($_POST['name'])) { $contact->first_name = $first_name; $contact->last_name = $last_name; } $address = new Address(); $address->city = $_POST['city']; $address->state_code = $_POST['state']; print_r($address); $contact->addAddress($address); $returnContact = $cc->updateContact(ACCESS_TOKEN, $contact);
This is basically the code from the example. I can't figure out how to update address information, though. We'd like to let folks put their city and state when they sign up. I'm getting the following error with this method. any help would be really appreicated!
[error_key] => json.max.items.violation [error_message] => #/addresses: 3 items were contained, but the maximum number of items allowed is 2.
If you look at the $contact object you're getting in the first call, you'll likely find that the Contact in question already has two addresses (one home and one work). We only support two addresses total, one of each type, so it looks like in this scenario you're adding a 3rd instead of updating one of the existing two, which is causing you to fail our JSON Schema validation for total number of items.
Ah, thanks! That's so obvious I feel dumb for missing it.
The holidays have come and gone. For many seasonal businesses, this means the rush of shoppers has decreased as well. Instead of turning off the lights and waiting for spring, make your email marketi...
See Article