Mint: How to subscribe to an external event from the app.js

  • 12 December 2018
  • 6 replies
  • 48 views

I am a newbie and i am trying to create our CTI app for Freshdesk Mint. Right now my problem is that i want to open the CTI sidebar when an external event comes in but i don't know to what event i must subscribe in the app.js. I can open the CTI in the app.activated event but what I want is something like this:


app.js

$(document).ready(function () {
    app.initialized()
            .then(function (_client) {
                var client = _client;

                var eventCallback = function (event) {
                    client.interface.trigger('show', {id: 'softphone'});
                };
                client.events.on("myExternalEvent", eventCallback);

            });
});


Besides I have registered in the server.js a callback url (in OnAppInstallation) and i have created the handler function for the external event (OnExternalEvent) following the same procedure that in the external_events_app but i don't now how to follow in order to open the CTI sidebar.



This topic has been closed for comments

6 replies

Hey Domingo,


This is Murali, Marketing Manager at Freshworks, in charge of ISV Partnerships and technical integrations. We would love to your app listed on the marketplace. I see that this has been raised as a ticket, but in case you have any issues with listing the app on the marketplace feel free to reach out or add a note here and I'm happy to provide assistance if any.


Regards,

Murali


Hi Murali:


My problem right now, as you can see, is to get the app working, which is a mayor problem in order to get my app listed on the marketplace. I am not sure if you have to help me but it is sure that i need help.


Greetings,

Antonio


You can open iFrame the CTI app using the Interface API (Global CTI), you could do this on the external events in app.js

Regarding the function in the server, it is not possible for the server to initiate a function call in the front-end thought the other way around can be done using SMI.


What I don't understand is how i can subscribe to an external event from
apps.js. I have created this external event as described at the
external events help. What are the concrete code if I want to subscribe at app.js to the example event "onExternalEvent"?


Hi Domingo,

unfortunatelly i am not able to help, but we are very interessted in an CTI Solution for Mint.


maybe you can get in touch with me?


Thanks, Bernd


Hi Bernd:


Finally we were able to get a Freshdesk CTI solution using another way. Feel free to contact us at info@monema.com.


Greetings,

Domingo