Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 9
Next »
With our API you can integrate uContact with other systems.
Prior to making any of the queries to the web services it is necessary to obtain the APIkey
through the Login.
To do this, we will use the UserLogin
service and enter a valid username and super user password.
Click here to expand UserLogin Service
User
Relative URL: Integra/resources/auth/UserLogin
Method: POST
content-type:application/x-www-form-urlencoded; charset=UTF-8
Params: user
password
Result: JSON
Where Md5secret is the APIKey or if it has no phone will have it on the 3rd item of the List
If error Response is 0
Supervisor con teléfono
Md5secret es la APIKey
[ ...
{
....
"md5secret": "Q2FyaW5hOjI3YzdjNWM5LTkzYzQtNDYyMi1iYzg2LTlkMmNkMGVjNWEzMA==",
....
}
]
Supervisor sin teléfono
Al final de la lista
[ ...
"QWRtaW46OTgzNWM1MjUtMzU2Ny00YjgyLWEwYWYtY2NkMjNlMDhjNzA3"
]
Si es Error Respuesta 0
Click here to expand jQuery example code
$.ajax({
type: 'POST',
url: 'https://<ucontactinstance>.ucontactcloud.com/Integra/resources/auth/UserLogin',
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 we will see how to use it in API queries:
JQuery can be configured to use the token in each request.
If not, it can be specified in the headers in each request made.
Click here to expand example configuration in jQuery
$.ajaxSetup({
headers: {
'Authorization': "Basic " + APIKey
}
});
Click here to expand example of token in authorization header
$.ajax({
type: 'POST',
url: 'https://<ucontactinstance>.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) => {}
});
After using the API it is necessary to end the session.
This way we will avoid security problems by disabling the token generated in the login of the startup.
Click here to expand and see the method
Relative URL: Integra/resources/auth/EndSession
Method: POST
content-type:application/x-www-form-urlencoded; charset=UTF-8
Params: user
token
Result: 1 OK 0 ERROR
Click here to expand example for jQuery code
$.ajax({
type: 'POST',
url: 'https://<ucontactinstance>.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) => {}
});
Postman collection for the Login and Logoff.
You may also be interested ...
Upload dialer base
Webcallback
Recordings