Skip to main content



No record found.

Microsoft Dynamics NAV forum

sending bearer token authentication in external API from NAV C/AL code

Posted on by 25

Hello All,

I am trying to use an API which is authenticated using bearer token. I have managed to generate access token from the provided API but How do I send the generated access token to another API for accessing its data. Below is the code :- 

HttpClient.BaseAddress := Uri.Uri(provide base url);
HttpResponseMessage := HttpClient.PostAsync(provided api path,HttpContent).Result;
result := HttpResponseMessage.Content.ReadAsStringAsync.Result;

Any help would be appreciated.


  • Alexei Pavlov Profile Picture
    Alexei Pavlov 20 on at
    RE: sending bearer token authentication in external API from NAV C/AL code

    I think you should use request header "Authentication" with "Bearer TOKEN_HERE".

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,989 Super User

Martin Dráb Profile Picture

Martin Dráb 225,588 Super User

nmaenpaa Profile Picture

nmaenpaa 101,148


Featured topics

Product updates

Dynamics 365 release plans