cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
399
Views
0
Helpful
3
Replies

can't get a phone book request from finesse

windleaf5188
Level 1
Level 1

Hello, I use Finesse Cisco Finesse 11.5 API. I can get a userinfo's request with jquery ajax from frontend, the codes like this:


$.ajax({

   url:"http://finesse2.cc.tel.mcra.fr/finesse/api/User/7131000",

   async:true,

   type:"get",

   headers:{

   Authorization:"Basic NzEzMTAwMDpmYmUxYnNlY2Vu"
   },

   success:function(res){

console.log(res)

  }

});

but I can't get the list of phone book, when I add

  "headers": {

    "range": "objects=1-1500",

  }

in my code:

$.ajax({

   url:"http://finesse2.cc.tel.mcra.fr/finesse/api/User/7131000/PhoneBooks",

   async:true,

   type:"get",

   accept : "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,objects=1-1500",

   headers:{

   Range: "1-1500",

   Authorization:"Basic NzEzMTAwMDpmYmUxYnNlY2Vu"
   },

   data:"",

   success:function(res){

   res4= res;

  }

});

I have a error :localhost/:1 XMLHttpRequest cannot load http://finesse2.cc.tel.mcra.fr/finesse/api/User/7131000/PhoneBooks. Request header field range is not allowed by Access-Control-Allow-Headers in preflight response.

Another question, I have 2 finesse server with adresse IP: finesse1 and finesse2, I would like if server finesse1  is dead, another server  finesse2 will be detected and  connected automatic. Can I have some API finesse for this question or do you have some good idea?

Thank you very much


3 Replies 3

dekwan
Cisco Employee
Cisco Employee

Hi,

For the phonebooks, the Range's value must be objects=1-1500. So, you should do:

$.ajax({

  url:"http://finesse2.cc.tel.mcra.fr/finesse/api/User/7131000/PhoneBooks",

  async:true,

  type:"get",

  accept : "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,objects=1-1500",

  headers:{

  Range: "objects=1-1500",

  Authorization:"Basic NzEzMTAwMDpmYmUxYnNlY2Vu"
  },

  data:"",

  success:function(res){

  res4= res;

  }

});

For your second question, each user is automatically subscribed to the SystemInfo node. If the Finesse server it is connected to goes down (any service other than tomcat or notification service), the user will get a SystemInfo event with a status of OUT_OF_SERVICE. In this SystemInfo event, it lists the other Finesse server's FQDN. It is up to the client to start using the Finesse server that is working.

Thanx,

Denise

Thanks for your response. I add the Range: "objects=1-1500" in my code but I have the same error like before:"Request header field Range is not allowed by Access-Control-Allow-Headers in preflight respo", because the Access-Control-Allow-Headers don't allow  to add a new field Range. I don't know how to add a new field range in the Access-Control-Allow-Headers.


For my seconde question, because my host and xmpp domain is the same adresse IP, so when my first server finesse goes down, I can't get the notification of systemInfo. Should I have two diffrente adresse IP for finesse host avec xmpp domain?

here is my system info:

<SystemInfo>

    <currentTimestamp>2017-08-09T15:00:19.503Z</currentTimestamp>

    <deploymentType>UCCE</deploymentType>

    <license></license>

    <peripheralId>5003</peripheralId>

    <primaryNode>

        <host>FRDC2ICMFIN2A.cc.tel.mcra.fr</host>

    </primaryNode>

    <secondaryNode>

        <host>FRDC3ICMFIN2B.cc.tel.mcra.fr</host>

    </secondaryNode>

    <status>IN_SERVICE</status>

    <systemAuthMode>NON_SSO</systemAuthMode>

    <timezoneOffset>120</timezoneOffset>

    <uri>/finesse/api/SystemInfo</uri>

    <xmppDomain>FRDC2ICMFIN2A.cc.tel.mcra.fr</xmppDomain>

    <xmppPubSubDomain>pubsub.FRDC2ICMFIN2A.cc.tel.mcra.fr</xmppPubSubDomain>

</SystemInfo>


Hi,

I haven't used ajax to make the REST API call, so unfortunately I do not know how to add a new field in the header. I had tried the REST API with that header using Postman against my Finesse system and it worked. Double check that the API itself is returning a successful response so that you know it is not an API issue.

For the second question, no, the host and xmpp domain is the same fqdn. What kind of failover are you doing? If it is a network failover, then I agree that you won't get any notifications. If that is the case, it is up to the client to ping the network and realize that it is out and switch to the other node. The client should do a GET on the SytemInfo and store the necessary information for this case.

Thanx,

Denise

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: