See the different possibilities that our API offers you to integrate uContact with external systems.
API Omnichannel
API Telephony
API Other Actions
API Gamification
DataBases
Examples
getUserToken Service
Code Block |
---|
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
Code Block |
---|
[ ... "QWRtaW46OTgzNWM1MjUtMzU2Ny00YjgyLWEwYWYtY2NkMjNlMDhjNzA3" ] If it is Error Answer 0 |
Example code for jQuery
Code Block |
---|
$.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) => {} }); |
jQuery configuration example
Code Block |
---|
$.ajaxSetup({ headers: { 'Authorization': "Basic " + APIKey } }); |
Token example in request headers
Code Block |
---|
$.ajax({ type: 'POST', url: 'https://dominio.ucontactcloud.com/Integra/resources/any/request', contentType: 'application/x-www-form-urlencoded; charset=UTF-8', dataType: 'text', headers:{ 'Authorization': 'Basic <APIKey>' }, data: { param1: 'exampleParam1', param2: 'exampleParam2' }, success: (resp) => {}, error: (resp) => {} }); |
Method
Code Block |
---|
https://dominio.ucontactcloud.com/Integra/resources/auth/EndSession Method: POST content-type:application/x-www-form-urlencoded; charset=UTF-8 Params: user token Result: 1 OK 0 ERROR |
Example code for jQuery
Code Block |
---|
$.ajax({ type: 'POST', url: 'https://domain.ucontactcloud.com/Integra/resources/auth/EndSession', contentType: 'application/x-www-form-urlencoded; charset=UTF-8', dataType: 'text', headers:{ 'Authorization': 'Basic <APIKey>' }, data: { user: 'ExampleUser', token: '<token>' }, success: (resp) => {}, error: (resp) => {} }); |
Relevant information
Note |
---|
|
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:
Code Block | ||
---|---|---|
| ||
window.addEventListener('message', event => { if (event.data.action === 'CLOSE_TAB') { parent.closeActiveTab(); } else if (event.data.action === 'DISPOSITION_CALL') { let dataDisp = event.data.disposition; UC_DispositionCall(dataDisp.campaign, dataDisp.callerid, dataDisp.guid, dataDisp.l1, dataDisp.l2, dataDisp.l3, dataDisp.d1, dataDisp.d2, dataDisp.comment, dataDisp.schedule, callbackDiposition, errorDiposition); } }); |
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:
Code Block | ||
---|---|---|
| ||
let dataDisp = { campaign: 'CampañaTest', callerid: '123456Test', guid:'3123-3123-3123-312-3123', l1:'nivel1', l2:'nivel2', l3:'nivel3', d1:'data1', d2:'data2', comment:'ComentarioTest', schedule:'2019-05-04 15:55:55' }; window.parent.postMessage({ action: 'DISPOSITION_CALL', disposition:dataDisp}, '*'); |
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:
Access the user menu.
Select the "API tokens" option in the dropdown menu and a modal will open for its creation.
Enter the name that you want to use to identify the token and click the "Save" button to create a new token.
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:
Postman collection for the Login and Logoff.
View file | ||
---|---|---|
|