Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

How to integrate Postman behaviour into Business Central Code?

(0) ShareShare
ReportReport
Posted on by 10

Hello!

I currently have a connection working with Postman. A new Access Token with OAuth2 has to be generated first before inserting the Json to send a request with POST and receive the right response. 

I would like to replicate/integrate this behaviour in Business Central instead of Postman. How could I do this exactly? 

I tried to read myself into API's but the example from Erik Hougaard didnt work for me, as the IP isnt showing.

How to make a simple API call with a json reply in Business Central - YouTube

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: How to integrate Postman behaviour into Business Central Code?

    So what you want to do is to call an external API from with in Business Central?

    if that is what you are looking for you have to write AL code and use the http client available in the AL language.

    learn.microsoft.com/.../httpclient-data-type

  • M.Sub Profile Picture
    M.Sub 10 on at
    RE: How to integrate Postman behaviour into Business Central Code?

    Thank you for the answer but I should have clarified that I wanted to establish the connection independent from Postman. Starting the connection works with postman, but the user should be able to send the request by himself with business central and receive the response without using postman.

  • Suggested answer
    Govinda Kumar Profile Picture
    Govinda Kumar 2,203 Super User 2024 Season 1 on at
    RE: How to integrate Postman behaviour into Business Central Code?

    To hit your codeunit service you have to use base OData URL provided by microsoft..

    pastedimage1682673972147v1.png

    api.businesscentral.dynamics.com/.../MyCodeUnit_Hello

    Hope it helps..
    Regards

  • Suggested answer
    Govinda Kumar Profile Picture
    Govinda Kumar 2,203 Super User 2024 Season 1 on at
    RE: How to integrate Postman behaviour into Business Central Code?

    Hi,

    You can create a custom procedure in your codeunit and then create a web service for that codeunit, you can hit the procedure of your codeunit using postman... here's the simple code unit with procedure..

    pastedimage1682671403900v4.png

    To create the web service, you can search for 'web services'...

    pastedimage1682671483223v5.png

    pastedimage1682670859094v2.png

    pastedimage1682670930511v3.png

    After creating the web service, you can call the procedure called 'Hello' using postman..

    pastedimage1682671649483v6.png

    hope it helps you...

    Regards

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans