I'm trying to get contact information for an integration project and i cant seem to get the list of custom fields to show up in the response body. I created "Custom Field 1" and "Custom Field 2" using the GUI and added some data. I tried both my code and the API tester in mashery.com but the JSON response body doesn't have any custom fields.
Any assistance will be greatly appreciated.
Thank you for reaching out to Constant Contact's API Support.
You were correct in naming the custom fields with a number; however it actually has to be named very specifically. custom_field_n
You used custom field 1 and needed to use custom_field_1 so the API could read it. Just an fyi we are working on a v3 of our API where the naming convention will be different. Once that is released this will be much easier to use.
Thanks Jimmy. I just tried it and it works. It also works as "customfield1" without spaces. I created 3 custom fields and i delete them using the GUI for both operations. Now i get an error when i try to re-create them. The API call still shows the list empty and the GUI has no custom fields.
I would try using the API and POSTing or PUTting to a contact using the custom field name that you deleted. I'm thinking that the name might still be "in use" in our system with an ID attached to is so when you go to create it again you are receiving an error. If you just assume the field is already created and you enter data in that field using the API (which doesn't really care to much if the field has been created or not as long as the name is correct) then it should work hopefully.
Let me know how that goes and if you still have problems feel free to email us at firstname.lastname@example.org so we can do some troubleshooting.
View API documentation, code samples, get your API key.