API

 

See the different possibilities that our API offers you to integrate uContact with external systems.

In order to use the API you need:

  1. Authenticate and get a token for the session.

  2. Use the token in the Authorization Header.

  3. Log out.

It is recommended to create a user that is exclusively to use with the uContact API.

 


API Omnichannel

API Telephony

API Other Actions

API Gamification

DataBases

Examples


Foremost, we need to get APIkey. For this, we use the getUserToken service with a valid SuperUser username and password.

getUserToken Service

https://dominio.ucontactcloud.com/Integra/resources/auth/getUserToken Method: POST content-type:application/x-www-form-urlencoded; charset=UTF-8 Parameters: user password Answer: JSON

Supervisor without phone

At the end of the list

[ ... "QWRtaW46OTgzNWM1MjUtMzU2Ny00YjgyLWEwYWYtY2NkMjNlMDhjNzA3" ] If it is Error Answer 0

Example code for jQuery

$.ajax({ type: 'POST',  url: 'https://domain.ucontactcloud.com/Integra/resources/auth/getUserToken',   contentType: 'application/x-www-form-urlencoded; charset=UTF-8',   dataType: 'text',   data: { user: 'ExampleUsername', password: 'ExamplePassword' }, success: (resp) => {}, error: (resp) => {} });

Once you have your login token, let's move on to how to use it in API queries:

  • jQuery can be configured to use the token on every request.

  • If not, it can be specified in the headers in each request that is made.

jQuery configuration example

Token example in request headers


After using the API, it is necessary to end the session. In this way, we will avoid security problems by disabling the token generated at the start login.

Method

Example code for jQuery


Relevant information

  • All WebServices are REST type.

  • uContact uses https by default (http2).

CrossDomain Connection

With the Windows proxy, we can handle events of an iframe inserted in a form, to be able to do dispositions, hang up the call, close the form, or whatever you want, for example. To do this, no plugin is needed.

Previous steps

In the form you must put:

event.data can be used to identify what type the action is.

And the disposition attribute is used as an object to send more information.

How to invoke it?

The way to invoke it is:


Token creation

Users with "SuperUser" role in uContact have the functionality to create tokens for use outside of the application. To create a token, follow these steps:

  1. Access the user menu.

     

  2. Select the "API tokens" option in the dropdown menu and a modal will open for its creation.

     

  3. Enter the name that you want to use to identify the token and click the "Save" button to create a new token.

     

  4. Once a token has been created in uContact, "SuperUsers" have the ability to share it with other users. To do so, simply click on the clip icon. This will automatically copy the token to the clipboard and it can then be sent to anyone with whom you wish to share it.


You may also be interested in:


Upload dialer base


Webcallback


Postman collection for the Login and Logoff.