I'm trying to use the FuelSDK-Node to perform some CRUD operations on a Data Extension. I'm not able to find any documentation except for the Readme on the GitHub page.
I was trying to use below function from the example app to insert record to DE but it's throwing an unhandled error.
function postDERow(req, res) {
var options = {
Name: "SDKDataExtension"
, props: { "Key": "ThisIsTheKey", "Value": "Some random text for the value field" }
};
var deRow = ET_Client.dataExtensionRow(options);
deRow.post(function (err, response) {
if (err) {
res.status(500).send(err)
} else {
var statusCode = response && response.res && response.res.statusCode ? response.res.statusCode : 200;
var result = response && response.body ? response.body : response;
response && res.status(statusCode).send(result);
}
});
};
I tried different function but it's also throwing an error
function insertRecord(req, res) {
const options = {
Name: '3637435F-XXXX-XXXX-XXXX-9D2045A92421',
Properties: {
"Property": [
{ 'Name': 'id', 'Value': 'xxxxx' },
{ "Name": "emailAddress", "Value": "[email protected]" },
{ "Name": "firstName", "Value": "xxxxx" },
{ "Name": "lastName", "Value": "xxxxx" },
{ "Name": "birthdate", "Value": "12/12/2000" },
{ "Name": "phoneNumber", "Value": "1231231233" },
{ "Name": "userId", "Value": "xxxxx" }
]
}
}
client.dataExtensionRow(options).post((err, resp) => {
if (err) {
console.log("\n\nerror \n\n")
console.log(err)
} else {
console.log(resp)
return resp;
}
});
}
ErrorMessage: 'Unable to retrieve Data Extension using Name'
Does anyone know where I can find any documentation regarding this or can provide some examples regarding CRUD operations on DE using FuelSDK?