Hello,
I have created a custom field alled "dringid" on my contacts.
It appears when I perform a curl requet :
curl -u APIKEY:X -X GET https://dring.freshdesk.com/api/v2/contacts/43000011679
{"active":false,"address":null,"company_id":null,"view_all_tickets":null,"description":null,"email":"matt.rogers@freshdesk.com","id":43000011679,"job_title":null,"language":"en","mobile":null,"name":"Matt Rogers","phone":null,"time_zone":"Eastern Time (US & Canada)","twitter_id":null,"custom_fields":{"dringid":"189"},"tags":[],"other_emails":[],"facebook_id":null,"created_at":"2018-05-11T12:47:15Z","updated_at":"2018-05-11T14:19:06Z","other_companies":[],"avatar":null}
I'd like to use it in my custom app with the JS library.
$(document).ready( function() {
app.initialized()
.then(function(_client) {
var client = _client;
client.events.on('app.activated',
function() {
client.data.get('contact')
.then(function(data) {
console.log(data.contact.custom_fields.dringid);
})
.catch(function(e) {
console.log('Exception - ', e);
});
});
});
});
But unfortunately, data.contact.custom_fields.dringid seems undefined.
How should I access this custom field ?
Regards,