cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
498
Views
0
Helpful
24
Replies
Beginner

Re: webex teams gadget

and on 17th i was getting the token successfully

 

2018-10-17T13:57:53.424 +05:30: 1B2CEC: eipsccxsa01.broadridge.net: Oct 17 2018 04:27:53.489 -0400: WebexTeamsTeamAnnouncementsGadget : _postData(): An error occurred while sending the messages to the room.
concat:15477:17
2018-10-17T13:57:54.353 +05:30: 1B2CEC: eipsccxsa01.broadridge.net: Oct 17 2018 04:27:54.418 -0400: Header : [ClientServices] MasterPublisher._parseAndPublishJSONEvent() - Received JSON event on node 'cuic-58020-desktop': {"ROWS":[{"id":"LakkarajuR","operation":"UPDATE","VoiceCSQDetailsStats":{"agentId":"LakkarajuR","agentName":"Ramu Lakkaraju","agentState":"Not Ready","skillGroup":"","agentStateDuration":548347,"reasonCode":200,"AgentVoiceCSQNames":[{"agentVoiceCSQName":"Edgewood Mainframe"}]}},{"id":"TippireddyN","operation":"UPDATE","VoiceCSQDetailsStats":{"agentId":"TippireddyN","agentName":"NagaLakshmi Tippireddy","agentState":"Ready","skillGroup":"","agentStateDuration":6394794,"reasonCode":0,"AgentVoiceCSQNames":[{"agentVoiceCSQName":"Edgewood Mainframe"}]}},{"id":"58020","operation":"UPDATE","VoiceCSQDetailsStats":{"agentId":"58020","agentName":"Ravi Kumar","agentState":"Not Ready","skillGroup":"","agentStateDuration":285166,"reasonCode":32760,"AgentVoiceCSQNames":[{"agentVoice…
finesse.js:15420:17
2018-10-17T13:57:54.778 +05:30: 1B2CEC: eipsccxsa01.broadridge.net: Oct 17 2018 04:27:54.843 -0400: WebexTeamsTeamAnnouncementsGadget : _updateGadget(): Webex Teams Room Id: Webex Teams Team Announcements
concat:15477:17
2018-10-17T13:57:54.779 +05:30: 1B2CEC: eipsccxsa01.broadridge.net: Oct 17 2018 04:27:54.844 -0400: WebexTeamsTeamAnnouncementsGadget : _getAccessToken(): Getting the access token
concat:15477:17
2018-10-17T13:57:54.780 +05:30: 1B2CEC: eipsccxsa01.broadridge.net: Oct 17 2018 04:27:54.845 -0400: WebexTeamsTeamAnnouncementsGadget : _getAccessToken(): Successfully retrieved the access token

Cisco Employee

Re: webex teams gadget

That was the wrong room id though:
2018-10-17T13:57:54.778 +05:30: 1B2CEC: eipsccxsa01.broadridge.net: Oct 17 2018 04:27:54.843 -0400: WebexTeamsTeamAnnouncementsGadget : _updateGadget(): Webex Teams Room Id: Webex Teams Team Announcements
concat:15477:17
2018-10-17T13:57:54.779 +05:30: 1B2CEC: eipsccxsa01.broadridge.net: Oct 17 2018 04:27:54.844 -0400: WebexTeamsTeamAnnouncementsGadget : _getAccessToken(): Getting the access token
concat:15477:17
2018-10-17T13:57:54.780 +05:30: 1B2CEC: eipsccxsa01.broadridge.net: Oct 17 2018 04:27:54.845 -0400: WebexTeamsTeamAnnouncementsGadget : _getAccessToken(): Successfully retrieved the access token

I am just brainstorming because I don't have a solution for you right now.
- If you go to https://eipsccxsa01.broadridge.net:8445/3rdpartygadget/files/WebexTeamsTeamAnnouncements/oauth.html, do you see "Authenticating...". I want to make sure that the oauth page is able to be loaded successfully.
- Have you tried to clear your cache to make sure it is loading the latest gadget
- Do you see any errors in the browser console after you accept the integration?

Thanx,
Denise
Beginner

Re: webex teams gadget

Yes i do see 'Authenticating'
Beginner

Re: webex teams gadget

Yes i have to actually clear the cache everytime i make a change in the files so yes I've tried that plenty of times.
Cisco Employee

Re: webex teams gadget

Ok, I would recommend modifying the oauth.html to have some alerts or console logs to see where it is going.

In the AJAX call, add an error callback function to see if it is going in there instead. I would also recommend adding some logging in the success callback to see if it is being stuck in there.

Also, look at the cookies on the browser and see if there is any value for spark_access_token.
Beginner

Re: webex teams gadget

seems like it is going to the else portion of the below code

 

     * Get the access token from the cookie that was set by the
     * OAuth. Return true if a token is found. False otherwise.
     */
    _getAccessToken = function () {
        clientLogs.log("_getAccessToken(): Getting the access token");

        // Get the access token from the cookie that was set by the oauth
        var value = "; " + document.cookie;
        var parts = value.split("; " + "spark_access_token" + "=");
        if (parts.length == 2) gadgetParams.token = parts.pop().split(";").shift();

        // Return true if found. False otherwise.
        if(gadgetParams.token) {
            clientLogs.log("_getAccessToken(): Successfully retrieved the access token");
            return true;
        } else {
            clientLogs.log("_getAccessToken(): Unable to retrieve the access token");
            return false;
        }
    },

 

below is the portion of oauth.html from where it gets the access token

 

if (hash[0] == "code") {
                        $.ajax({
                            url: 'https://api.ciscospark.com/v1/access_token',
                            type: "post",
                            headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
                            data: "grant_type=authorization_code&client_id=" + OAuthClientId + "&client_secret=" + OAuthClientSecret + "&redirect_uri=" + encodeURI(redirectURI) + "&code=" + hash[1],
                            success: function(data) {
                                var cookieName = 'spark_access_token';
                                var cookieValue = data.access_token;
                                var myDate = new Date();
                                myDate.setMonth(myDate.getMonth() + 1);
                                document.cookie = cookieName +"=" + cookieValue + ";domain=." + finesseDomain + ";path=/";
                                window.close();

Cisco Employee

Re: webex teams gadget

Hi,

 

I was referring to modifying the oauth.html:

$.ajax({
    url: 'https://api.ciscospark.com/v1/access_token',
    type: "post",
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    data: "grant_type=authorization_code&client_id=" + OAuthClientId + "&client_secret=" + OAuthClientSecret + "&redirect_uri=" + encodeURI(redirectURI) + "&code=" + hash[1], 
    success: function(data) {
        var cookieName = 'spark_access_token';
        var cookieValue = data.access_token;
        var myDate = new Date();
        myDate.setMonth(myDate.getMonth() + 1);
        document.cookie = cookieName +"=" + cookieValue + ";domain=." + finesseDomain + ";path=/";
        window.close();
    }
});

Add an error clause to the ajax call and see if it is going in there instead of the success. Also add logging to both to see what path is being taken.

 

Thanx,

Denise

Beginner

Re: webex teams gadget

Error clause, you mean like an alert message?
Cisco Employee

Re: webex teams gadget

I mean an error callback similar to the success one. You can put an alert message in there if you want. Some sort of logging to let you know if the ajax call is going to the success or error.
Beginner

Re: webex teams gadget

Ok thanks. I'll report to you tomorrow.
CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards