I'm trying to populate the FIRSTNAME
attribute for SendInBlue when creating a contact (using their official C# wrapper).
But it keeps displaying this exception:
{"Error calling CreateContact: {\"code\":\"invalid_parameter\",\"message\":\"attributes should be an object\"}"}
My code:
Configuration.Default.ApiKey.Add("api-key", "XXXX");
var apiInstance = new ContactsApi();
var apiAttributes = new AttributesApi();
var createContact = new CreateContact
{
Email = email,
Attributes = "{\"FIRSTNAME\":\"Matt\"}"
};
try
{
CreateUpdateContactModel result = apiInstance.CreateContact(createContact);
}
catch (ApiException ex)
{
}
I've tried so many different methods, it's now been over 24 hours of failing so I thought I'd ask StackOverflow. Does anybody know what I'm doing wrong?