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: