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 :
Finance | Project Operations, Human Resources, ...
Unanswered

How to send data from Staging table (D365FO) to an external API (Postman)?

(3) ShareShare
ReportReport
Posted on by 32
Hi,

I’m working on sending data from Dynamics 365 Finance and Operations(staging table) to an external API (tested via Postman) for the first time. I’m looking for guidance on the best approach, sample code, or any blogs/tutorials that can help. Any tips or examples would be greatly appreciated!
Categories:
I have the same question (0)
  • Martin Dráb Profile Picture
    237,795 Most Valuable Professional on at
    Please tell us more about your requirements. Do you mean that you created a web service, tested it with Postman and now you want to send the same request from F&O instead of Postman?
     
    Are you sure that you want to make a direct call and that you insist on custom development in F&O? There are many alternatives, e.g. that you could have a Power Automate flow reading the data from F&O through a virtual entity and passing it to the web service. If you have no idea, show us what request you make in Postman.
  • CU26060544-0 Profile Picture
    32 on at
    Thanks for your response. My goal is to push data directly from D365FO to the external API. I do not need to create a web service; I just want the data to be sent to the API. I prefer not to use Power Automate or any low-code flows, and I want to achieve this through custom development in F&O.
    I would really appreciate if anyone could share guidance, sample code, or best practices for implementing this type of direct API integration in D365FO.
  • Martin Dráb Profile Picture
    237,795 Most Valuable Professional on at
    We mean the same thing when I say 'a web service' and you say 'an API'. You seem to have an HTTP-based web service, which is a specific type of an application programming interface (API). API is much more generic term than what you actually mean.
     
    To write code calling your web service (API), you need to know what kind of web service it is. Most likely, it's either REST-like or a SAOP one. The documentation page Consume external web services is for the latter. If you have no idea, show us what request you make in Postman.
  • Navneeth Nagrajan Profile Picture
    2,407 Super User 2025 Season 2 on at
    Hi CU26060544-0,
     
    Since you are using Postman for the first time would recommend using the Postman pre-configured by Anthony Blake. You can tweak the Postman tool based on your requirement and add the required public collection name associated with the data entity. 
     
    Always used this blog as a reference for D365 F&O scenarios related to external web services.
     
    References:
  • CU26060544-0 Profile Picture
    32 on at
    Thanks for clarifying. I’ve got an HTTP-based REST API (for example: https://api.restful-api.dev/objects). Now I want to know how to get the data from this API using X++ code  and handle the response in JSON format.
     
    Could anyone please guide me on what classes need to be created in D365FO for this integration (for example, service classes, contracts, or helper classes) and share any sample code or best practices?
  • Martin Dráb Profile Picture
    237,795 Most Valuable Professional on at
    There are several ways, the most straightforward one is making an HTTP request with HTTP-related classes in .NET, such as System.Net.Http.HttpClient. The example mentioned by Navneeth uses HttpClient as well.
     
    Nevertheless it may be beneficial to create your own .NET library and utilize Paste JSON as classes to generate classes for easy deserialization of JSON to objects. Also, if you have an Open API (Swagger) specification of the API, you may generate the whole service client. 
  • CU26060544-0 Profile Picture
    32 on at

    Thanks for the suggestions. My goal is to push data from D365FO directly to an external REST API in JSON format. I want guidance on how to structure the X++ classes — including service classes, helper classes, and contracts. Also, could someone explain what exactly the response class does and what it should contain?. The blog mentioned by Navneeth

     

     
     
     
     
  • Martin Dráb Profile Picture
    237,795 Most Valuable Professional on at
    I suggest you first try what you asked about. Create a single runnable class and call the web service with hard-coded data. Only when you're able to make a call at all, you can think about JSON serialization and such things. Don't try to do everything at once.
     
    What classes will you need depends on what logic you'll need. It's not clear whether you'll need any contract class in X++, you won't create any helper class if you don't need any etc.
     
    The web service may return a response, but you didn't mention being interested in it, therefore ignore it for now.
  • Ashik Patel Profile Picture
    275 on at
    Hello,
     
     
    Can you please explain what excet you want ?
  • Navneeth Nagrajan Profile Picture
    2,407 Super User 2025 Season 2 on at
    Hi CU26060544-0,
     
    Agree with the suggestion provided by Martin. First write a simple runnable class using the HttpRequest related classes in .NET and apply the serialization techniques. Then resolve all the interoperability issues or data conversion techniques. Once the runnable class is ready, you can create the custom class and use the runnable class as a base to build the custom class.
     
    The other challenge you might encounter later is with respect to deployment. If you are implementing custom dlls ensure you move them smoothly across branches. A lot of times custom dlls do give issues when moving across to higher environments.
     
     

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans