The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

Custom field update during list subscribe (java/api v2)

SOLVED
Go to solution
Highlighted
Occasional Advisor

Custom field update during list subscribe (java/api v2)

 

/*REPOSTING AS NEW USER - SORRY FOR CONFUSION*/

 

We named our Custom Field 1 'Signup Date' in the admin gui on the constant contact site.  When we subscribe users to our list, they are added successfully but the custom field is not updated.
REQUEST:
{{
    "column_names":
    ["EMAIL"
    ,"FIRST NAME"
    ,"LAST NAME"
    ,"CUSTOM FIELD 1"
    ]
    ,"import_data":
    [{
        "custom_fields":[
            {"name":"Signup Date"
            ,"value":"foo"
            }
        ]
        ,"first_name":"testf"
        ,"last_name":"testl"
        ,"email_addresses":[
            "jeffsank@jeffsank.com"
        ]
    }]
    ,"lists":[
        "1924786102"
        ]
}}
RESPONSE:
{
    "id":"25b909e0-dae0-11e3-a5b7-d4ae52986b44"
    ,"type":"ADD_CONTACTS"
    ,"error_count":0
    ,"contact_count":1
}

We poll for the activity id and eventually get the 'completed' status but the custom field never shows up when we view the contact via the constant contact site..

Is my data formatted correctly?  Can I update that field when subscribing a person to a list?  Or is that a separate operation?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Honored Contributor

Re: Custom field update during list subscribe (java/api v2)

Fortunately, it's a pretty simple fix. The issue here is that the naming for the field names in the JSON is off by a couple spaces. Here's a working version of your JSON:

 

{
    "column_names":["EMAIL","FIRST NAME","LAST NAME","CUSTOM FIELD 1","CUSTOM FIELD 2"]       
    ,"import_data":[
            {
            "custom_fields":[{"name":"Custom Field 1","value":"2014-06-04"},{"name":"Custom Field 2","value":"monthly"}]
            ,"first_name":"testf"
            ,"last_name":"testl"
            ,"email_addresses":["js_crm@js.com"]
            }
    ]
    ,"lists":["1924786102"]
    }
}

 

Let me know if anything else comes up for you!

 

Sincerely,

Elijah G.
API Support Engineer

View solution in original post

7 REPLIES 7
Highlighted
Honored Contributor

Re: Custom field update during list subscribe (java/api v2)

Hello,

 

With the APIs, we currently only support Custom Fields that retain the naming scheme from the previous contact management interface. Because of this, only Custom Fields with the name CustomFieldN where N is a number 1 - 15. You can find a bit more information about this in our documentation here: http://developer.constantcontact.com/docs/contacts-api/contacts-index.html

 

While we are aiming to improve the functionality of the API to support these new fields, it is not currently available and the only solution for custom fields is to retain the CustomField1 - CustomField15 naming.

 

If you do have any additional questions or any concerns, please feel free to reply to this topic and we will be happy to help further!

Elijah G.
API Support Engineer
Highlighted
Occasional Advisor

Re: Custom field update during list subscribe (java/api v2)

We have now named the field CustomField3 via the site - we are sending

{
  {"column_names":["EMAIL","FIRST NAME","LAST NAME","CUSTOM FIELD 3"]
  ,"import_data":[{"custom_fields":[{"name":"CustomField3","value":"foo"}],"first_name":"testf","last_name":"testl","email_addresses":["jeffsank3@jeffsank.com"]}]
  ,"lists":["1924786102"]
  }
}

Again, the person is added but the custom field never shows up.  I've done it with new contacts and existing.  At this point we're stuck so any help would be much appreciated.

Thanks!

Highlighted
Honored Contributor

Re: Custom field update during list subscribe (java/api v2)

Hello,

 

I want to take a moment an apologize for my long delay in getting back to you! We have been working with all hands on deck to resolve this issue you've experienced (custom fields not importing properly) as well as some other issues with bulk importing.

 

The good news that I have is that this issue with Custom Fields was an issue in our system and has been fixed in production and is now functioning normally again. If you are still experiencing issues with this for any reason, please let us know so that we can take a look at it ASAP.

 

Best Regards,

Elijah G.
API Support Engineer
Highlighted
Occasional Advisor

Re: Custom field update during list subscribe (java/api v2)

 

Still having same issue - contact added but custom fields don't show up - any thoughts?

 

{

{
    "column_names":["EMAIL","FIRST NAME","LAST NAME","CUSTOM FIELD 1","CUSTOM FIELD 2"]       
    ,"import_data":[
            {
            "custom_fields":[{"name":"CustomField1","value":"2014-06-04"},{"name":"CustomField2","value":"monthly"}]

            ,"first_name":"testf"
            ,"last_name":"testl"

            ,"email_addresses":["js_crm@js.com"]
            }
    ]
    ,"lists":["1924786102"]
    }
}

Highlighted
Honored Contributor

Re: Custom field update during list subscribe (java/api v2)

Fortunately, it's a pretty simple fix. The issue here is that the naming for the field names in the JSON is off by a couple spaces. Here's a working version of your JSON:

 

{
    "column_names":["EMAIL","FIRST NAME","LAST NAME","CUSTOM FIELD 1","CUSTOM FIELD 2"]       
    ,"import_data":[
            {
            "custom_fields":[{"name":"Custom Field 1","value":"2014-06-04"},{"name":"Custom Field 2","value":"monthly"}]
            ,"first_name":"testf"
            ,"last_name":"testl"
            ,"email_addresses":["js_crm@js.com"]
            }
    ]
    ,"lists":["1924786102"]
    }
}

 

Let me know if anything else comes up for you!

 

Sincerely,

Elijah G.
API Support Engineer

View solution in original post

Highlighted
Occasional Contributor

Re: Custom field update during list subscribe (java/api v2)

 

Success - thanks so much!

Highlighted
Occasional Advisor

Re: Custom field update during list subscribe (java/api v2)

 

Successs!  Thanks so much!

Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured