Here is my xml for adding:
<summary type="text">Customer document</summary>
<Contact xmlns="http://ws.constantcontact.com/ns/1.0/">Customer document
I keep getting a 400 error. I am getting the list id from the API as well so I know that is working. Any ideas?
After inspecting your XML, I have found multiple issues with your XML that is causing this error.
To correct these errors, please change your ID node from <id>2</id> to <id>data:,none</id>. In addition, the contact details fields are case sensitive, meaning <emailaddress> must be changed to <EmailAddress> in order to function correctly.
Lastly, when creating a contact, not all fields are required to be sent. Although sending additional empty fields will not cause any errors, they are not required to be included in your XML for successful contact creation.
Please use the following XML as a reference for your future contact creations:
<title type="text"> </title>
Support Engineer, Constant Contact
Yes I figured those out. I do not know why my xml was not camel case as the php is correct. I ran it again and it was fine. I also have extra fields because I intend on using them but have not filled them in for initial tests.
I figured out how to remove contacts from the list(not moving to the 'Do Not Mail' list). But when I try to add that same contact again it cannot add because they allready exist. Any ideas? Thanks.
Once an email address has been added to Constant Contact, they are never fully removed. If you have removed the contact from all contact lists and wish to add them back to other lists, you must update the contact that already exists. Typically I would recommend this type of flow for this.
2. If the contact exists, obtain their id from the XML returned from the search and use this to retrieve the full contact details
This will take the contact out of 'removed' status and place them in whatever list(s) you chose.