I have few queries regarding the “Full Page Freshdesk Applications”, like if we try to add a component to a freshdesk existing Api end point we are getting that component, we are also able to see the sidebar loaded.
Now if we want do the same for a full page application we are not getting that sidebar loaded, there is a API call to fetch data and we have checked that we are getting data but the rendering of an whole application in freshdesk on a custom Api end point is what I am curious about.
I am new to freshdesk and this is the Code which I have followed from a article →
‘’’
document.addEventListener(“DOMContentLoaded”, function ()
app.initialized().then((_client) => {
const client = _client;
client.events.on('app.activated', () => {
client.data.get('domainName').then((data) => {
document.querySelector('#domain .label').innerHTML = data.domainName;
getData(data.domainName);
}, (err) => {
showError('User domainName request failed.');
console.error('User domainName request failed.', err);
});
});
function getData(domainName) {
const options = {
headers: {
'Authorization': 'Basic <%= encode(iparam.api_key) %>',
'Content-Type': 'application/json',
}
};
const STATUS_CODES = [2, 3, 4, 5];
Promise.all(STATUS_CODES.map((status) => {
const url = `https://${domainName}/api/v2/search/tickets?query="status:${status}"`;
return client.request.get(url, options);
})).then((responses) => { render(responses); })
.catch((err) => {
showError('API request(s) failed.');
console.error('API request(s) failed.', err);
});
}
‘’’
Now the thing working for a simple component like a to do list on tickets page, if we want to implementing similarly an full page component with no extra information and just sidebar, how we can do it.