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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

How to create a custom API. How can I expose an URL to the external system for custom Api.

(0) ShareShare
ReportReport
Posted on by 8

How to create a custom API. How can I expose an URL to the external system for custom Api.

I have the same question (0)
  • cloflyMao Profile Picture
    25,210 on at

    Hi phanikumar,

    Would your requirement be something likes below?

    Assume you have built a form, when user submits the form, submitted data will be inserted into Dynamics?

    Regards,

    Clofly

  • phanikumar Profile Picture
    8 on at

    Yes Clofly, I have to save or retieve(search) dynamics entities. How can I create and deploy Api to dynamics crm?

    Thanks

    Phani.

  • cloflyMao Profile Picture
    25,210 on at

    Hi phanikumar,

    We need two tools for different purposes.

    1. Retrieve Dynamics entities: create an OData set from an entity list record in Portal Manament App, we can expose some records from a specific entity.

    https://www.inogic.com/blog/2019/03/retrieve-dynamics-365-crm-data-in-portal-by-calling-odata-using-javascript/ 

    2. Send data from your web application to Dynamics, and give callback response: We could deploy a flow with HTTP Request Trigger action and Response action in Power Automate.

    HTTP Request Trigger will generate an endpoint URL for us to process our request, then the trigger will send our data to Dynamics and give us a response.(optional)

    Due to there is no validation to access the URL, so we need some security steps to protect the endpoint.(send validation data together with user data.)

    https://flow.microsoft.com/en-us/blog/call-flow-restapi/

    Summary:

    Method 1 is static, our result is pre-defined in Dynamics, so we couldn't send any keyword to filter data.

    Method 2 is flexible, we could customize response body, thus it's possible to search records in Dynamics.

    e.g:

    The start HTTP Request trigger will receive my requested data as keyword to search related records in Dynamics.

    pastedimage1588669395790v1.png

    Set listed records as Body content of Response directly:

    pastedimage1588669503182v2.png

    Search whether there are contacts whose last name equal "Mao",

    we can see a XHR request will be sent, and get retrieved Dynamics data from callback data(Response Body).

    pastedimage1588669730021v3.png

    expand an item:

    pastedimage1588669915169v4.png

    Regards,

    Clofly 

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    You have multiple options to create custom API which will intreact with CRM indirectly.

    Microsoft Flow- You can create flow with trigger as HTTP trigger which will generate webhook URL that you can provide to external syste topost the data and as an action you create say lead record in CRM from flow.

    Azure function- Azure function is serverless computing service provided by microsoft which has HTTP trigger to generate webhook or posting URL. You can write custom c# code parse the data which is sent by external system and then create record in crm or perform any operation

    See below article on Azure function step by step by guide on how to create Lead in crm from external system.

    xrmdynamicscrm.wordpress.com/.../

    If found helpful, Please mark my answer verified.

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 72 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 29 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans