Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

How to get Proper Response in REST API?

(0) ShareShare
ReportReport
Posted on by

From POSTMAN 

{
    "timestamp""30-04-2021 08:58:54 AM",
    "path""zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz",
    "status""UNAUTHORIZED",
    "kgcpErrorCode""INVALID_TOKEN",
    "msg""Token 6489ac41-6249-48d5-aec9-25ea618a2f77 is invalid. Please provide a valid Token."
}

From POSTMAN getting proper JSON as Response.

While consuming Same REST API from D365FO.

Code:

catch
{
str logFailed,logFailed1;
ex = CLRInterop::getLastException();


if (ex != null)
{
ex = ex.get_InnerException();
if (ex != null)
{
logFailed += ".Inner exception = " + ex.ToString();
}
}
info( logFailed);
//return ex.Message;

}
catch (Exception::CLRError)
{
str logFailed;
ex = CLRInterop::getLastException();
if (ex != null)
{

ex = ex.get_InnerException();
logFailed += ".Inner exception = " + ex.ToString();
}
info( logFailed);
}

Getting following exception: The remote server returned an error: (401) Unauthorized.

How I can get same response as POSTMAN.

 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Adis Profile Picture

Adis 136 Super User 2025 Season 1

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 81

#3
Jonas "Jones" Melgaard Profile Picture

Jonas "Jones" Melgaard 77 Super User 2025 Season 1

Product updates

Dynamics 365 release plans