Skip to main content
Post a question

Notifications

Community site session details

Community site session details

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

How to generate access token in D365 F&O

Like (0) ShareShare
ReportReport
Posted on 21 Apr 2022 06:55:49 by 45

Hi All,

I have a scenario where i am having an API that needs to be called from D365 F&O through x++ code. I tested it in postman and its working fine. Now i need to add X++ code to generate access token, then use this token to call API. 

I am not sure how to achieve that. If someone can help me with sample code will be of great help.

goshoom  - Could you please help on this

Thanks,

Dev

  • Dev Shekhawat Profile Picture
    45 on 21 Apr 2022 at 08:08:59
    RE: How to generate access token in D365 F&O

    Hi goshoom ,

    By API, yes i meant REST API. Also when i talk about token its using Client id and client secret from Azure. Find below screenshot of postman(removed client id and secret from screenshot).

    pastedimage1650528433708v1.png

    Thanks,

    Dev

  • Martin Dráb Profile Picture
    232,594 Most Valuable Professional on 21 Apr 2022 at 07:50:09
    RE: How to generate access token in D365 F&O

    API is extremely generic term - it covers any programming interface.

    I guess that you're talking about a RESTful web services, therefore you'll need to send an HTTP request.

    You also mentioned an access token, but that can also mean many things. Please tell us which authorization mechanism is used by your web service. For example, you may want to show us the steps that you did in Postman (that you're now trying to do from X++).

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

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,518 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,594 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans
Loading complete