web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

How to generate access token in D365 F&O

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Martin Dráb Profile Picture
    237,985 Most Valuable Professional on at

    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++).

  • Dev Shekhawat Profile Picture
    45 on at

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
iampranjal Profile Picture

iampranjal 41

#2
Martin Dráb Profile Picture

Martin Dráb 38 Most Valuable Professional

#3
Satyam Prakash Profile Picture

Satyam Prakash 35

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans