Facing error when trying to add a note using the SDK

I am trying to a note using the latest SDK but I am facing the below issue
const freshdesk = require(’@freshworks/freshdesk’);
let freshdeskObj = new freshdesk({ domain: ${iparams.fdDomain}.freshdesk.com, api_key: iparams.apiKey });
let notes = {};
notes[‘bodyText’] = callbackData;
freshdeskObj.Notes.addNote(65, notes).then(function (result) {
console.log(‘Data’);
console.log(result);
}, function (err) {
console.error(err);
})

I also tried like this freshdeskObj.tickets.addNote(65,notes)…

Please help me with this issue. Thanks

1 Like

Hi @Chris_Blesson,

A proper syntax is as follows,

const freshdesk = require(’@freshworks/freshdesk’);

const freshdeskObj = new freshdesk({ domain: `${iparams.fdDomain}.freshdesk.com`, api_key: iparams.apiKey });
freshdeskObj.tickets.addNote(65, {bodyText: ""});

Refer to the Freshdesk SDK sample app for the sample snippets.
The methods on the documentation under the same header will go on the same object. We will update the documentation to reflect this rightly.

2 Likes

Thank you @Raviraj Ill try this from the app

1 Like