Skip to main content

Notifications

Announcements

No record found.

Supply Chain Management forum
Suggested answer

How to create Rest API in x++

Posted on by 135

Hey Everyone,

Hope you all are doing great!

Actually I'm new to web services and I have to create an API which creates Sales order in d365 F&O from the 3rd party system. My API should be JSON based so please give me any sample code or idea how to create an Rest API for the same.

  • Vishu Beniwal Profile Picture
    Vishu Beniwal 135 on at
    RE: How to create Rest API in x++

    Hi Nikolaos,

    Really appreciate your efforts. Thanks for providing your expertise .

  • Vishu Beniwal Profile Picture
    Vishu Beniwal 135 on at
    RE: How to create Rest API in x++

    Hi Martin,

    Really appreciate your efforts for making me understand the situation here. I'll learn about all the integration strategies an do development according to that.

  • Martin Dráb Profile Picture
    Martin Dráb 228,112 Most Valuable Professional on at
    RE: How to create Rest API in x++

    By the way, third-party system isn't the same as integration. That's just a source of data and an integration architect must decide how data will be fetched from there.

    The architecture must respect capabilities of each system (therefore you can't design it before learning what APIs does F&O offer) all business requirements, including things like performance, reliability and security.

    For example, you may want to build the architecture in a way that doesn't require both system running at the same and no direct communication between them. Let's say that the other system would put mesesages to a Service Bus Queue and a Logic App would monitor the queue and pass messages to F&O.

  • Martin Dráb Profile Picture
    Martin Dráb 228,112 Most Valuable Professional on at
    RE: How to create Rest API in x++

    If no existing data entity meet your needs, simply go and create a custom one. But it might also suggest that you're not doing the right thing. For example, maybe you should use a composity data entity via one of the data management APIs.

  • Vishu Beniwal Profile Picture
    Vishu Beniwal 135 on at
    RE: How to create Rest API in x++

    Hi Nikolaos,

    By 3rd party I mean the 3rd party software developer team from which we need to fetch the sales order  

  • nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: How to create Rest API in x++

    Anyway, perhaps Data Package RESTI API could be the right approach, you can use it to import Sales order composite entity. However please make sure that all relevant details are considered in the technical decision. Now it's still cheap to adjust the plans, because nothing is yet developed.

  • nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: How to create Rest API in x++

    Hi Vishu,

    do you mean that the other party is the integration architect and you just need to follow their plan?

  • Vishu Beniwal Profile Picture
    Vishu Beniwal 135 on at
    RE: How to create Rest API in x++

    Hi Martin actually the other party just want one service, they just want one service for sales order header and line not separate separate. Can you please help me out here?

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 228,112 Most Valuable Professional on at
    RE: How to create Rest API in x++

    Let me give you something better - I'll teach you how you can find it by yourself.

    I'll assume that you have F&O development environment tools. Open Application Explorer and find data entities related to sales orders. You'll do it by typing a search expression to the search box on the top of Application Explorer. If you want to find data enties with names starting with "Sales" and containing "Order", you'll use type:dataEntity ^sales.*order.

    Then review the list; you should spot SalesOrderHeaderV2Entity and SalesOrderLineV2Entity. That's likely what you want.

    Also, look at properties of these entities and notice PublicEntityName and PublicCollectionName. These are names used in OData.

  • Vishu Beniwal Profile Picture
    Vishu Beniwal 135 on at
    RE: How to create Rest API in x++

    Hi Martin can you please let me know the data entity name so I can check that.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,263 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,112 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans