cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
982
Views
2
Helpful
3
Replies

Make a Call thru API

dhavalmistry9
Level 1
Level 1

Hi Team,

I am new member in the cisco finesse.

I am working on one requirement to make call from our Dynamics 365 (CRM) screen to customer (click to call). Dynamics 365 has customer detail with phone number. As of now user has to type phone number into cisco finesse app after reading from dynamics 365.

I am trying to built "click to call" solution in CRM, custom button using javascript make call thru cisco finesse API. I have tried connecting API thru postman based on cisco finesse development guide but I am facing 400 error. 

Any help or correct direction would help. Appreciate your support.

3 Replies 3

dekwan
Cisco Employee
Cisco Employee

Hi,

If you are getting a 400 error, it usually means there is something missing/invalid in your request. Here is the documentation for making a call: https://developer.cisco.com/docs/finesse/#!dialog%e2%80%94create-a-new-dialog-make-a-call/dialogcreate-a-new-dialog-make-a-call

Also, make sure that the user making the call is signed in: https://developer.cisco.com/docs/finesse/#!user%e2%80%94sign-in-to-finesse

Can you paste/screenshot your API request here? 

Thanx,

Denise

Hey

Remember if it is an UCCX you have to use the port 8445

Dialog—Create a New Dialog (Make a Call) - Finesse - Document - Cisco Developer

With Jquery:

 

 

var settings = {
  "url": "https://<your server>l:8445/finesse/api/<userId>/Dialogs",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/xml",
    "Authorization": "Basic 1234567890"
  },
  "data": "<Dialog>\r\n   <requestedAction>MAKE_CALL</requestedAction>\r\n   <fromAddress>1001</fromAddress>\r\n   <toAddress>1002</toAddress>\r\n</Dialog>",
};

$.ajax(settings).done(function (response) {
  console.log(response);
});

 

 

This code is from postman where agent 1001 is making a call to 1003 (an working)

The authorization is the agents username and passwordas basic auth (Not 1234567890 :-)).

The from address is the agents extensions, and the to address is the number the agent is calling.

As Denise is write. The agent has to be logged in

Without jQuery (Fetch method) :

 

 

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/xml");
myHeaders.append("Authorization", "Basic 1234567890");

var raw = "<Dialog>\r\n   <requestedAction>MAKE_CALL</requestedAction>\r\n   <fromAddress>1001</fromAddress>\r\n   <toAddress>1003</toAddress>\r\n</Dialog>";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://<your server>:8445/finesse/api/User/<userId>/Dialogs", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

 

 

 

 

Please rate helpful posts and if applicable mark "Accept as a Solution".
Thanks, Thomas G. J.

And screenshot from postman

ThomasGJohannesen_0-1687869565604.png

ThomasGJohannesen_1-1687869606262.png

 

Please rate helpful posts and if applicable mark "Accept as a Solution".
Thanks, Thomas G. J.