NSRPureCld | 2018-05-13 00:02:41 UTC | #1
Tim,
When I ask these questions please realize that I am very new to Pure Cloud. So if my questions are simplistic, please bear with me.
I went thru an example for implicit authentication (you said earlier: I would recommend implementing the OAuth Implicit Grant1 to authorize your CRM app ).
I have questions about the code that was presented in an example to get a pureCloudSession and set up notifications. Questions are given below; If you could please answer next to the question.
Question. What is happening in the following code ?
var pureCloudSession = purecloud.platform.PureCloudSession({ strategy: 'implicit', clientId: 'babbc081-0761-4f16-8f56-071aa402ebcb', redirectUrl: window.location.href });
More Questions regarding the piece of code above
1. where did he get the clientid from ?
2. what is the purpose of redirectUrl ?
3. is this process single signing on to Pure Cloud from my CRM java script ?
Then Later the code uses the pureCloudSession to get the following: var usersapi = new purecloud.platform.UsersApi(pureCloudSession); var notificationsapi = new purecloud.platform.NotificationsApi(pureCloudSession); var presenceApi = new purecloud.platform.PresenceApi(pureCloudSession);
Then later:
usersapi.getMe('presence') .then(function(data){ // Store user ID myUserId = data.id;
// Get presence definition var presenceDefinitionId = data.presence.presenceDefinition.id; presenceApi.getPresenceId(presenceDefinitionId).then(function(data) { $("#currentPresence").text(data.languageLabels.en_US); });
Question. Why is he getting the user's presence ? What does that mean ?
Then sets up notifications
// Create a notification channel notificationsapi.postChannels().then(function(data){ // Start a new web socket using the connect Uri of the channel webSocket = new WebSocket(data.connectUri); webSocket.onopen = function(){ // Now that the connection is open, we can start our subscriptions. userPresenceTopic = 'v2.users.' + myUserId + '.presence'; conversationsTopic = 'v2.users.' + myUserId + '.conversations'; notificationsapi.postChannelsChannelIdSubscriptions(data.id, [ { "id": userPresenceTopic }, { "id": conversationsTopic }]); };
Question. So when the user picks up the phone in Pure Cloud, a java script function written by me will be called/notified ? Is this correct ? As shown below.
Question. from the data that Pure Cloud sends to my function, how will I know when he picked up the call and when the call ended ?
Question. is the data sent into my callback function a JSON string ?
webSocket.onmessage = function(message) { // Parse string message into JSON object var data = JSON.parse(message.data);
Questions.
1. I was told that Pure Cloud is a desk top application ?
Is this true ?
2. In the scenario that I described above, I am assuming that my CRM and Pure Cloud App are running on my machine ? Do you concur ?
Thanks for all your help.
tim.smith | 2018-05-14 15:07:18 UTC | #2
What is happening in the following code ?
That example is out of date; it's based on the old beta version of the SDK. See the Authorization section of the SDK Documentation for a proper example of how to authenticate using the current SDK. That documentation is all up to date. The task to update the tutorials is scheduled to be worked on soon.
where did he get the clientid from ?
https://developer.mypurecloud.com/api/rest/authorization/create-oauth-client-id.html
what is the purpose of redirectUrl ?
See the section Redirect URIs here: https://developer.mypurecloud.com/api/rest/authorization/index.html
is this process single signing on to Pure Cloud from my CRM java script ?
If you wish to use single sign on, you don't need to do anything differently in your application. Simply configure a SSO provider in PureCloud and your users can choose to log in with the SSO provider when the login process redirects them to the PureCloud login page.
Why is he getting the user's presence ? What does that mean ?
Part of the tutorial is showing how to make an authenticated request after logging in. Getting the user's presence is just an example. You can read more about presences in the dev center article Understanding Presence and some general information about Presence, status, and activity indicators on the resource center.
So when the user picks up the phone in Pure Cloud, a java script function written by me
will be called/notified ? Is this correct ?
You set a callback function that will be invoked whenever a websocket receives a notification. This function will receive the notification data so your application can handle it appropriately.
from the data that Pure Cloud sends to my function, how will I know when he picked up the call and when the call ended ?
Inspect the data in the conversation object. To determine what happened in the event, compare the previous conversation object (cached by your app) with the one from the event. For example, if a participant's state was previously connected and is now disconnected, this tells you that they have left the conversation. Or if there wasn't a conversation end time previously and there is in the new event, this tells you that the conversation ended.
is the data sent into my callback function a JSON string ?
Yes.
I was told that Pure Cloud is a desk top application ? Is this true ?
PureCloud is a web-based platform. There are desktop apps available if you don't want to run them in your web browser. Integrations can be done from any language and platform that is able to consume REST APIs.
In the scenario that I described above, I am assuming that my CRM and Pure Cloud App are running on my machine ? Do you concur ?
There is no requirement for them to be on the same machine; users can log in to multiple apps in multiple places. However, from the scenarios you've described, I would assume your situation to be the PureCloud application to be loaded in one browser tab and your CRM with the embedded client-side integration in another tab.
NSRPureCld | 2018-05-16 12:12:07 UTC | #3
Tim,
I followed the "Create an OAuth Client". It seems that the process will pop up a Pure Cloud login screen. Then when the user enters his credentials, an access token will be generated and sent to the redirect url. The access token can then be used for the various API calls. Is my understanding correct ?
If the user enters an incorrect login/password, then what happens ? Does the login screen stay in place till the user has entered correct login/password ?
What if our scenario is different ? Suppose the user is separately logged in our CRM and separately logged on to as well as Pure Cloud. Then how will our CRM establish contact/trust with Pure Cloud ?
tim.smith | 2018-05-16 13:19:57 UTC | #4
Is my understanding correct ?
yes
If the user enters an incorrect login/password, then what happens ? Does the login screen stay in place till the user has entered correct login/password ?
This should be pretty easy for you to test yourself.
What if our scenario is different ? Suppose the user is separately logged in our CRM and separately logged on to as well as Pure Cloud. Then how will our CRM establish contact/trust with Pure Cloud ?
Different sessions for a user are unaware of each other and have no bearing on each other.
NSRPureCld | 2018-05-16 20:24:55 UTC | #5
Tim thanks for your help. A few more questions.
Question #1. In OAuth implicit code grant - is the clientid same for an organization ? Meaning that if there are 5 users, then for each one we pass the same clientid; pure cloud login Pops up and each signs in and they go their Merry Way ? After each user logs in, a call queue gets associated with it ? Correct ? Who defines these users and queues in Pure Cloud ? Also are there different types of Queues ?
Question #2 Access token will be used by my CRM to set up notifications. So when a call comes in a help desk user's queue, access token associated with that help desk user will be used to call back into my CRM browser. Is my understanding correct ?
Question #3 When setting up notifications for a user, I am only interested in being notified that he/she picked up the phone. I am not interested in other types of notifications. Is this possible ? Or my CRM will get all notifications and I will process only those that I am interested in and ignore the rest ?
Question #4 When setting up notifications for a user, I am only interested in being notified that he/she picked up the phone. I am not interested in other types of notifications. Is this possible ? Or my CRM will get all notifications and I will process only those that I am interested in and ignore the rest ?
Question #5 I am assuming the phone number of the call will be in the notification. Is this a correct assumption ?
Question #6 I also was reading up on "OAuth With Client Credentials". This uses a clientid and secret key. Here Again is there a single clientid for an organization ? What about the secret key ? Is this unique to an organization too ?
After all it is not specific to a user and so cannot be used to set up call notifications. Correct ? What could this type of authorization possibly be used for ?
tim.smith | 2018-05-17 13:52:14 UTC | #6
is the client_id same for an organization ?
OAuth clients are scoped to a region. Any user from any org in the region can use an OAuth client that was defined in that region to log in to their org.
After each user logs in, a call queue gets associated with it ? Correct ?
I think you're referring to concepts in other telephony systems. I'm not sure what you're asking about in PureCloud.
Who defines these users and queues in Pure Cloud ?
Usually an administrator or whomever is configuring PureCloud.
Also are there different types of Queues ?
Yes. See the queues documentation.
Access token will be used by my CRM to set up notifications. So when a call comes in a help desk user's queue, access token associated with that help desk user will be used to call back into my CRM browser. Is my understanding correct ?
If you're asking "do I use my access token to make API requests?", the answer is yes.
Or my CRM will get all notifications and I will process only those that I am interested in and ignore the rest ?
This.
I am assuming the phone number of the call will be in the notification. Is this a correct assumption ?
Yes.
I also was reading up on "OAuth With Client Credentials"
You're building a user app. You need to use the implicit or auth code grants. Client credentials are only for non-user apps.
It sounds like you may benefit from a consulting contract with Genesys Professional Services. They can walk you through the application and the APIs and provide you guidance in a 1 on 1 setting. If you're interested in contracting Genesys PS, please contact your sales representative and they can initiate the PS engagement process.
NSRPureCld | 2018-05-17 16:58:01 UTC | #7
In reference to your following response:
I think you're referring to concepts in other telephony systems. I'm not sure what you're asking about in PureCloud.
I am thinking of the work flow as follows. See if you agree.
1. Suppose Tim and Jerry are two service call personnel who have their individual Think Pads in front of them and each one has logged into our CRM (which is web based). So the CRM screen is in front of them (in their individual browser windows on their individual Think Pads). They have also logged into Pure Cloud with "OAuth Implicit Grant" via the CRM. Further suppose notifications have been set up in the CRM (using notifications API) so when they pick up a call, notification is sent to their CRM browser window.
Are you with me so far ?
2. When a calls comes in, I am assuming that they will show up in their "Pure Cloud Display Console" on each of their respective think pads. If 10 calls come in all at once, all these 10 calls will show as a list on each of their "Pure Cloud Display Console". They have to click on one call from the list to answer the call.
Is my assumption correct ?
3. Suppose Tim decides to field the call; so he clicks on one of the 10 phone number in his "Pure Cloud Display Console" window. This will make his phone on his desk ring and he picks up the phone. It is at this time that Pure Cloud will send a notification to the his CRM Browser window along with a phone number.
Do you agree ?
The queues I was referring to were the "place" where the phone calls (all 10 of them) "land" for Tim or Jerry so that they can click on one of them to answer the call.
Do you agree with the scenario ?
tim.smith | 2018-05-17 17:04:38 UTC | #8
Your description sounds more or less correct. I'd suggest testing this out for yourself so you can see it in action and observe the behavior directly.
I'm vaguely remembering something, possibly in Cisco or Avaya, where a user had to log in to the system and separately connect to a "personal queue" to be able to receive calls. That's not how PureCloud works. The user just logs in to PureCloud and can accept direct calls automatically, as long as they have selected a phone to use and are in an available presence. If they are a member of an ACD queue and go on queue, they can then also receive ACD calls.
NSRPureCld | 2018-05-17 18:33:41 UTC | #9
Tim - Your prompt replies are really appreciated.
There are 10 help desk personnel and all of them have logged into pure cloud. Two of them are busy fielding calls; 8 of them are free (not on the phone). Then the next call comes in. Which one of the 8 gets the ring on his phone ? Is there an algorithm that decides to which one of the 8 the call should be channeled ?
I am assuming all 8 phones will not start ringing simultaneously for the new call !
tim.smith | 2018-05-17 18:36:31 UTC | #10
NSRPureCld, post:9, topic:2862
Which one of the 8 gets the ring on his phone ? Is there an algorithm that decides to which one of the 8 the call should be channeled ?
Information about the ACD process can be found on the resource center: https://help.mypurecloud.com/articles/purecloud-acd-concepts/
system | 2018-06-17 18:36:33 UTC | #11
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 2862