Open jahvi opened 11 years ago
Hi Javier,
I updated the API docs for Contacts yesterday regarding CustomFields here: http://developer.constantcontact.com/docs/contacts-api/contacts-collection.html?method=POST
Sounds like your account is using the new contact management system which supports custom fields with fewer or no restrictions on naming. Currently the API only supports the CustomField1 -> 15 naming convention, and ignores custom fields that don't follow that convention. I'll check for other open issues that you might be running into, if any. Rich
I see, that's a bummer
On Sat, Oct 26, 2013 at 10:33 AM, richm541 notifications@github.com wrote:
Hi Javier,
I updated the API docs for Contacts yesterday regarding CustomFields here:
http://developer.constantcontact.com/docs/contacts-api/contacts-collection.html?method=POST
Sounds like your account is using the new contact management system which supports custom fields with fewer or no restrictions on naming. Currently the API only supports the CustomField1 -> 15 naming convention, and ignores custom fields that don't follow that convention. I'll check for other open issues that you might be running into, if any. Rich
— Reply to this email directly or view it on GitHubhttps://github.com/constantcontact/php-sdk/issues/29#issuecomment-27148046 .
Ing. Javier Villanueva
Any update on this in the API?
Hi Jason,
We are starting work on making the API user experience re:Contacts to be on par with the GUI experience now that all accounts have been migrated to the new contact management system. This will be ongoing work, with iterative updates over 6 -12 months, with iniitial changes expected in Q4 this year. I am being conservative and open so as not to set inappropriate expectations.
Rich
Would it be possible to pull in a list of said custom fields via the API?
@richm541 is there any update on the ability to use $label
and $name
with a custom field, without the CustomField###
naming requirement?
I've never used the GUI or API for ConstantContact before, but see nothing in the custom field or contact panels in the GUI to set a "label" and "name" for the fields separately. Attempting to set a label via the API fails (null
response from the ContactService
). The same goes when setting the field names to anything but CustomField###
.
@deefour The description of the custom_field property can be found here: http://developer.constantcontact.com/docs/contacts-api/contacts-collection.html?method=POST#structure
Only custom fields using the prescribed customfieldn format are available via API at this time.
That becomes a new custom field, but it cannot be viewed in the API because the name does not use customfieldn naming format.
@zanematthew - You cannot grab a list of just the custom fields, you can only view custom fields as related to a contact object.
@richm541 glad to know.
Its been years now... is this still a problem? it is for me... still stuck using "CustomField1" and "CustomField2" instead of super important sane human words like "Signup Source" and "Industry Interest"
Its been years now Seemingly so. Maybe they've OOB?
Anyway, you can make your code more readable by introducing an interface or maybe a DTO, or maybe just simple constants, pun intended ;) into your object/functions/code/whatever.
<?php
namespace ConstantContactFixerCrapper;
Class Constants {
const SIGNUP_SOURCE = 'CustomField1';
const INDUSTRY_INTEREST = 'CustomField2';
}
cheers ☕
I have a custom field in my account called "comment" however when I try to create a new contact like this:
I get the following error:
It looks like the API expects the custom field name to be "CustomFieldNN" and it looks like my "comment" field is getting assigned as "CustomField0" but even if I change my code to:
I still get the same error, is it not possible to add/update named custom fields?