Introduction to Daktela JS integrations
Daktela can be integrated with browser-based application where you can control users from simple operations such as logging in or out, to more complex ones like working with calls, sending SMSes or creating tickets. The integrations uses our API that supports JSONP. Alternatively, we can allow JSON for Cross-Origin Resource Sharing. API authorisation is achieved using an accessToken unique for each user. It can be sent as a value in the request, in a cookie or in the header under the X-Auth-Token name. You can call these actions manually or use our CLI library which is currently in experimental stages.
How to log a user in to a queue
Queues are used to manage individual channels such as web chat, calls, SMSes etc. A user needs to be logged in to an outgoing queue to make a call. For more info, see our API documentation.
How to make a call for a user
To create a call, you will need the accessToken of a user who is allowed to make calls or has rights to another user that is allowed to make calls (if you want to create a call for another user). For more info, see our API documentation.
How to get current user state
If you need your app to display the user's current state in Daktela, ie. if they have an open call, if they are on a pause or what queues they are logged in to, you can use a one-off query or HTTP long polling. For long polling, you will first need to send the hash parameter. After you receive the response, enter the value into the hash – this is used to detect changes. For more info, see our API documentation.
Simple example integration
This example shows how to create a simple application which can log a user in and control their pauses: