Unable to create a purecloudsession in Ireland

Hi, all,

I try to create a PureCloud Session to Ireland environment.
As written in the docs it should work like this:

<script src='https://code.jquery.com/jquery-1.11.3.min.js'></script>
<script src="https://sdk-cdn.mypurecloud.com/javascript/0.51.1/purecloud-api.min.js"></script>
<title>PureCloud API</title>

<script type="text/javascript">
    var pureCloudSession = purecloud.platform.PureCloudSession({
          strategy: 'implicit',
          clientId: '7e2f3de6-e99e-4fbb-af90-e1227dd0aa34',
          redirectUrl: window.location.href,
          environment: 'mypurecloud.ie'
        });

But it won't.
Running that page still point me to mypurecloud.com where the ID does not exist.

Many thanks
Frank

I'm not sure, this code works for me and redirects me to login.mypurecloud.ie. You may have to debug the session object.

<html>
<head>
    <script src='https://code.jquery.com/jquery-1.11.3.min.js'></script>
    <script src="https://sdk-cdn.mypurecloud.com/javascript/0.51.1/purecloud-api.min.js"></script>
    <title>PureCloud API</title>

    <script type="text/javascript">
        var pureCloudSession = purecloud.platform.PureCloudSession({
              strategy: 'implicit',
              clientId: '7e2f3de6-e99e-4fbb-af90-e1227dd0aa34',
              redirectUrl: window.location.href,
              environment: 'mypurecloud.ie'
            });

            pureCloudSession.login()
          .then(function(){
            var users = new purecloud.platform.UsersApi(session);
            users.getMe()
              .then(function(user) {
                // successfully got the user object, do something with it here
              })
              .catch(function(error) {
                // an error occurred getting the user object
              })
              .finally(function() {
                // this will be called for successes and failures
              });
        });
        </script>
</head>
<body>

</body>
</html>

Damn. Stop NodeJS and start it again solved that. That wasn't expected.
Thanks for your help
Aplogize for that post

Frank

1 Like