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- Custom Message in MCS

edited Aug 30, 2017 7:00AM in Digital Assistant & Mobile 1 comment

Summary

401- Custom Message in MCS

Content

Hi,

In my custom API i am returning status 401 with a custom message, however, when we test the api we get only 401 unauthorized status code and not the custom message. How can we achieve this?

In the code, if the authenticateToken is 401, I am not able to return my custom message.

ut . h

enticateToken.statusCode

var result = {        statusCode:authenticateToken.statusCode,        success:false,        message:authenticateToken.message      };      console.log("Response Object:"+ JSON.stringify(result,undefined,2));      res.status(authenticateToken.statusCode).send(result);

Regards

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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