Thank you for supporting the Cloud Customer Connect Community in 2024. It's a gift to work with you!

Look back
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

401 Unauthorised error While calling MCS API in Ionic 3

edited Jul 24, 2017 7:00AM in Digital Assistant & Mobile 9 comments

Summary

401 Unauthorised error While calling MCS API in Ionic 3

Content

Hi,

I have developed an application for connecting cordova mcs client sdk in Ionic 3 but unfortunately I got unauthorised 401 error

I have followed the steps given  below to call mcs API

declare var mcs:any;

var backend;

var mcs_config = {

  "logLevel": mcs.LOG_LEVEL,

  "logHTTP": true,

  "mobileBackends": {

   "CUST_FW_SCREEN_MB1.0": {

   "default": true,

   "baseUrl": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",

   "applicationKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",

   "analytics": {

   "location": true

  },

   "authorization": {

   "basicAuth": {

   "backendId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",

   "anonymousToken": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

  }

  }

  }

  }

}

then I have intialised mcs like this

constructor(public http: Http) {

   console.log('Hello SampleProvider Provider');

  }

initializeMCS(){

   mcs.mobileBackendManager.platform = new mcs.CordovaPlatform();

   mcs

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!