cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
688
Views
0
Helpful
5
Replies

User authentication for api request in gadget code.

sylvester
Level 1
Level 1

Hi,

I have a finesse gadget that needs to get a call variable from a dialog using the url /finesse/api/User/<user_id>/Media/<media_id>/Dialogs.

My question is - will the finesse desktop take care of the user authentication meaning I only have to perform a get request in my gadget code.

Thanks

Sylvester

1 Accepted Solution

Accepted Solutions

Hi Sylvester,

Looking at the JsDoc, I see:

  • onLoad(this): (optional) callback handler for when the object is successfully loaded from the server
  • onChange(this): (optional) callback handler for when an update notification of the object is received
  • onAdd(this): (optional) callback handler for when a notification that the object is created is received
  • onDelete(this): (optional) callback handler for when a notification that the object is deleted is received

Based off of the description of the onChange, it should fire when there is a change with the dialog. Also, there is an onAdd and onDelete handler which should handle the added or deleted scenario.

Thanx,

Denise

View solution in original post

5 Replies 5

dekwan
Cisco Employee
Cisco Employee

Hi Sylvester,

If you are trying to call the API from a Finesse gadget, you can actually use the JavaScript API from the finesse.js which will handle the authentication: JsDoc Reference - finesse.restservices.User

But, to directly answer your question, it depends on how you are calling the REST API. If it is with gadgets.io.makeRequest, then you will have to do your own authentication. If it is with the finesse.js's clientservices, then you do not. I don't see the clientservices make request documented, but if you open the finesse.js file itself, you can see the methods.

Thanx,

Denise

Hi Denise,

Thx for reply.

Id like to use the API Finesse Gadget. In the above URL example, do i call getMediaList or getMediaDialogs - JsDoc Reference - finesse.restservices.MediaDialogs

I am trying to access a variable that is assigned to a non-chat media dialog.

Thx

Sylvester

Hi Denis,

I was able to successfully grab the callVariable, thx for help.


Just one further question - does an 'onChange' event for getMedia fire when there is a change with in the MediaDialog - for example a state change, of does it only fire when a new Dialog is added or deleted.

We would like to monitor state.


Thx

Sylvester.


Hi Sylvester,

Looking at the JsDoc, I see:

  • onLoad(this): (optional) callback handler for when the object is successfully loaded from the server
  • onChange(this): (optional) callback handler for when an update notification of the object is received
  • onAdd(this): (optional) callback handler for when a notification that the object is created is received
  • onDelete(this): (optional) callback handler for when a notification that the object is deleted is received

Based off of the description of the onChange, it should fire when there is a change with the dialog. Also, there is an onAdd and onDelete handler which should handle the added or deleted scenario.

Thanx,

Denise

Thanks for your help Denise..

Ill look into the onload further and you can close the thread.

Thanks again

Sylvester.