This is how my importRequest JSON object looks like. I just stringify it using JSON.stringify.
const importRequest = {
name: "test_import",
files: [
{
fileName: "accounts.csv",
fileFormat: "CSV",
fileImportPage: {
hasHeader: true,
columnMappings: [
{
columnName: "Email",
propertyName: "email",
columnObjectType: "CONTACT",
},
{
columnName: "First name",
propertyName: "firstname",
columnObjectType: "CONTACT",
},
{
columnName: "Last name",
propertyName: "lastname",
columnObjectType: "CONTACT",
},
{
columnName: "Phone number",
propertyName: "phone",
columnObjectType: "CONTACT",
},
{
columnName: "Created At",
propertyName: "createdat",
columnObjectType: "CONTACT",
},
],
},
},
],
};
This is how my csv file looks like. It’s placed in the same folder as the index.js file.
All I get is the notorious
body: {
status: 'error',
message: 'Unable to process JSON',
correlationId: '9ea8d506-36a3-4cea-b0a8-33f336d6233c'
},
error. ANY HELP is appreciated. I have tried all formating checks from the community posts but none seem to work for me.
