Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

How to generate access token in D365 F&O

Posted on 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
    Dev Shekhawat 45 on at
    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
    Martin Dráb 230,235 Most Valuable Professional on at
    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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans