cancel
Showing results for 
Search instead for 
Did you mean: 
Due to an issue with YouTube, inserting videos in your emails is showing an error. Until they are able to resolve this issue, we recommend using a different video hosting service. We will continue to monitor this outage and update you as we have more information.

Max Length Violation on fields we are not changing — json.max.length.violation

SOLVED
Occasional Participant

Max Length Violation on fields we are not changing — json.max.length.violation

Hey there!  Our integration updates some custom fields for existing subscribers when new appointments are booked in Acuity.  We've been receiving some json.max.length.violation errors for fields we are not updating.

 

Eg, for the notes field:

`json.max.length.violation` `#/notes/0/note: Value exceeds maximum length of 500.`

 

It looks like the notes field can be longer than 500 characters, set from the UI.  Trying to update these subscribers w/o changing the notes field later on results in the above error.

 

Any tips?

 

Here's an example response I receive from the API as JSON:
{
"id": "1513658931",
"status": "ACTIVE",
"first_name": "Bob",
"last_name": "Burger",
"confirmed": false,
"source": "API",
"email_addresses": [
{
"id": "09fa3e20-fb39-11e4-be0c-d4ae527b77f8",
"status": "ACTIVE",
"confirm_status": "NO_CONFIRMATION_REQUIRED",
"opt_in_source": "ACTION_BY_VISITOR",
"opt_in_date": "2015-05-15T19:31:52.000Z",
"opt_out_date": null,
"email_address": "legopartytime+bob3@gmail.com"
}
],
"prefix_name": "",
"job_title": "",
"addresses": [],
"notes": [
{
"id": "8bf9e0b0-633e-11e6-a9eb-d4ae5292c36f",
"note": "This is just a really long note so that I can try some things out. It could be bad if I can make it too long, right?This is just a really long note so that I can try some things out. It could be bad if I can make it too long, right?This is just a really long note so that I can try some things out. It could be bad if I can make it too long, right?This is just a really long note so that I can try some things out. It could be bad if I can make it too long, right?This is just a really long note so that I can try some things out. It could be bad if I can make it too long, right?This is just a really long note so that I can try some things out. It could be bad if I can make it too long, right?This is just a really long note so that I can try some things out. It could be bad if I can make it too long, right?This is just a really long note so that I can try some things out. It could be bad if I can make it too long, right?",
"created_date": "2016-08-15T23:18:16.000Z"
}
],
"company_name": "",
"home_phone": "",
"work_phone": "",
"cell_phone": "",
"fax": "",
"custom_fields": [
{
"name": "CustomField1",
"value": "2015-04-30"
},
{
"name": "CustomField2",
"value": "Invoice Appointment"
}
],
"lists": [
{
"id": "1426405611",
"name": null,
"status": "ACTIVE",
"contact_count": null,
"created_date": null,
"modified_date": null
}
],
"created_date": "2015-05-15T19:31:52.000Z",
"modified_date": "2016-08-15T23:18:16.000Z",
"source_details": "Acuity Scheduling Dev"
}

Sending it right back with a PUT cases the error.

5 REPLIES 5
Moderator

Re: Max Length Violation on fields we are not changing — json.max.length.violation

Hello,

Thank you for reaching out to Constant Contact API Support.

 

While our current Contact Management platform does support note fields with a length above 500 characters, our API only supports a limit of 500 characters at this point. This is because our API still has limits from our older Contact Management platform. While I can't provide a timeframe for when we will have updated functionality, limits, and features, I can say we are working to get them out as quickly as we can.

 

The best way to work around this limitation is to update your contacts' note fields via the Constant Contact website. You can also leave off the Notes parameter completely from your PUT requests if you are not updating the information stored there.

 

If you have any other questions, please let me know!

 

Sincerely,
David B.
API Technical Support Specialist

Moderator

Re: Max Length Violation on fields we are not changing — json.max.length.violation

Sorry, just to correct a small typo in my original reply, the API limits the Notes field to 500 characters, not 50.

 

Sincerely,
David B.
API Support Specialist

Occasional Participant

Re: Max Length Violation on fields we are not changing — json.max.length.violation

Hey David, thanks for your reply!

 

I see in a couple places in the docs that not sending a property clears it — and when updating a Contact I should first retrieve the full contact, then send it back with my changes:

http://developer.constantcontact.com/docs/contacts-api/contacts-index.html#update_contact

http://developer.constantcontact.com/docs/contacts-api/contacts-resource.html?method=PUT

 

Is that not the case for notes field?  (I'm seeing the same issue with addresses, too).

 

Best,

-Carl

Highlighted
Honored Contributor

Re: Max Length Violation on fields we are not changing — json.max.length.violation

Hi Carl,

 

David is out of the office today, so I wanted to jump in and get you some info.

 

While your assumption is correct (that information which is not provided is removed), we have created an exception for notes and addresses because the current version of our UI supports options for greater numbers of notes and addresses than the system that our API relies on. Because of this, the API is not capable of managing all notes/addresses, so the behavior of removing those was disabled to prevent accidental deletion of data.

 

Please let me know if I can provide any additional information!

 

Sincerely,

Elijah G.
API Support Engineer
Occasional Participant

Re: Max Length Violation on fields we are not changing — json.max.length.violation

Thanks guys, that did it!  All set.