function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Eugene Eruslanov 3Eugene Eruslanov 3 

Can't create contact in Marketing Cloud via API call. What am I doing wrong?

Hi!
I'm taking the Thrailhead training "Develop for Marketing Cloud". I'm trying to create a contact as it's prescribed in the training and getting a strange schema validation error (see below).

Request:
POST https://<mydomain>rest.marketingcloudapis.com/contacts/v1/contacts
{
"contactKey": "example@salesforce.com",
"attributeSets": [{
"name": "Email Addresses",
"items": [{
"values": [{
"name": "Email Address",
"value": "example@salesforce.com"
},
{
"name": "HTML Enabled",
"value": true
}]
}]
}]
}

Response
{
"operationStatus": "FAIL",
"rowsAffected": 0,
"requestServiceMessageID": "795568de-bb94-400d-b000-82592435e8ce",
"responseDateTime": "2021-04-13T17:35:51.8625471-06:00",
"hasErrors": true,
"resultMessages": [
{
"formatStringParams": [
"ValueDefinition",
null,
null,
"HTML Enabled"
],
"messageFormatString": "Unable to resolve schema element of type: {0} by reference. [Id: {1}, Key: {2}, Name: {3}]",
"resultType": "Validation",
"resultClass": "Error",
"resultCode": "SchemaObjectNotFoundByReference",
"message": "Unable to resolve schema element of type: ValueDefinition by reference. [Id: , Key: , Name: HTML Enabled]"
}
],
"serviceMessageID": "d38ed5f4-7583-4fe5-80cd-60a7c09f2f1b"
}cable, include links.
VinayVinay (Salesforce Developers) 
You can reach out to Success - Salesforce Marketing Cloud page on https://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F9300000001pQ5CAI for inputs on your ask.

Thanks,