Skip to main content

Notifications

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.

  • Suggested answer
    Bipin D365 Profile Picture
    28,981 Moderator on at
    RE: How to create a custom API. How can I expose an URL to the external system for custom Api.

    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.

  • cloflyMao Profile Picture
    25,208 on at
    RE: How to create a custom API. How can I expose an URL to the external system for custom Api.

    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 

  • phanikumar Profile Picture
    8 on at
    RE: How to create a custom API. How can I expose an URL to the external system for custom Api.

    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,208 on at
    RE: How to create a custom API. How can I expose an URL to the external system for custom Api.

    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

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Eugen Podkorytov Profile Picture

Eugen Podkorytov 106

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106 Most Valuable Professional

Overall leaderboard

Product updates

Dynamics 365 release plans