By Areej Sultana

How to Configure Custom APIs in Microsoft Dynamics 365 Using Power Apps

In this article, we’ll walk through the process of creating custom APIs in Microsoft Dynamics, focusing on the essential configurations in Power Apps.

First question is why do we use Custom API:

Custom APIs in Dynamics provide a flexible way to define specific request and response parameters, enabling tailored integrations with external systems. They offer improved performance, security, and reusability for handling custom business logic efficiently.

By defining a custom API, you can set specific request and response parameters according to your requirements. This guide will use a simple implementation to demonstrate how you can quickly set up and customize your own API.

First defining Custom API :

Custom API definition:

you can create API in the power platform by clicking on the new button.

you need to define unique name for API, I have given itk_customapitest for demonstration purpose.

Custom APIs in Microsoft Dynamics 365 Using Power Apps
Configuration for Custom API

Request Parameter:

This is used to get any prior information that can be used in the implementation such as Guid, string or Id. you can define unique name , also it can be set as an optional (Yes/No).

Custom APIs in Microsoft Dynamics 365 Using Power Apps
Request Parameter

Response Parameter:

This is used to show the response related to custom API, you can define type of that, I have selected string for now, and custom API referenced will be attached to it.

Custom APIs in Microsoft Dynamics 365 Using Power Apps
Response Parameter

For Implementation, I have defined simple custom API(itk_customapitest) ,and one request and response parameter with it.

Now, the question is how can we use this custom API in our implementation and can make use of that, so here is simple answer to that, we can simple define the plugin against that will be trigger when this particular API will be called.

I have created simple basic Plugin class to implement this API.

Custom APIs in Microsoft Dynamics 365 Using Power Apps
Attached Assembly

This Assembly reference will be attached in the Plugin Type of a Custom API.

Referenced Code

Now, its time to call the our custom API, I am using postman to call that, this will be post call, you can get the URL of the API in the developer resources in the advanced settings in power apps, and will simple attach your custom API name to that.

Call to Custom API

Hope, this article is helpful, and you get to learn about the custom API implementation in dynamics.

Let's Shape the Future Together!

Ready to shape the future of your business? Connect with ITKnocks, your catalyst for innovation. Let’s collaborate and transform possibilities into reality. Contact us, and let the possibilities unfold!