web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / How to consume Dataver...
Power Pages
Answered

How to consume Dataverse Custom API from Power Portals?

(0) ShareShare
ReportReport
Posted on by 132

Hi All,

 

Is it possible to consume the Dataverse custom API (unbound) from within Power Portals using JS? If so, please share a sample code for the same.

 

Thanks in advance!

 

Regards,

Sahil

Categories:
I have the same question (0)
  • eugenevanstaden Profile Picture
    441 on at

    You cant consume it from Portal, however you can implement the Portal API.
    https://docs.microsoft.com/en-us/power-apps/maker/portals/web-api-overview



  • eugenevanstaden Profile Picture
    441 on at

    You cant consume it from Portal, however you can implement the Portal API.
    https://docs.microsoft.com/en-us/power-apps/maker/portals/web-api-overview



  • Sahil Profile Picture
    132 on at

    Hi, I have gone through this documentation already but could not find any details on how to call Dataverse Custom APIs from within Power Portal.

     

    Some Background details:

    I created a Custom API record in Dataverse and associated a plugin to the same API.  Now, I need to call this API from Portal with some Input Parameters in the request and get output parameters as the response. 

  • Sahil Profile Picture
    132 on at

    I saw this post that talks about how to call custom actions from Portal and we get a custom action for a Custom API as well so shouldn't we be able to consume the APIs in the same way from Portal?

     

    https://debajmecrm.com/call-custom-action-using-webapi-in-powerapps-portals-dynamics-365-portals/ 

  • Verified answer
    eugenevanstaden Profile Picture
    441 on at

    You wont be able to call Custom API directly. If you want to consume the Custom API/Custom Action then there are other options.

    You can call a Flow, which executes the Custom API, or you can set up a Companion API. I prefer the Companion API approach as its secure - https://docs.microsoft.com/en-us/power-apps/maker/portals/oauth-implicit-grant-flow

    You dont want to expose ClientId/Secret in Javascript.




  • eugenevanstaden Profile Picture
    441 on at

    Custom Actions via the Portal API was on the roadmap - not sure where it is at in terms of when its in public preview

  • Sahil Profile Picture
    132 on at

    Hi,

     

    Based on my analysis/hits and tries so far, I am able to call any custom action and custom API that is bound to the CONTACT entity from Power Portals. But, I am still not able to get the response/output parameters from the API call if it is a success. The below syntax works:

     

    webapi.safeAjax({

    type: "POST",

    url: "/_api/contacts("ENTER GUID")/Microsoft.Dynamics.CRM.new_contactapi",

    contentType: "application/json",

    data: JSON.stringify({ "name": "Test" }),

    success: function (res, status, xhr){

    }

    });

  • eugenevanstaden Profile Picture
    441 on at

    I have done similar but yes as long as its bound action, if unbound then an issue. Did you check the response header for any output?

  • Sahil Profile Picture
    132 on at

    Yea, I tried to check the Response Header in the developer console but nothing is there. However, if you try to create a new record using the Portal API then you get the ID (entityid) of the record in the response header.

     

    I believe that maybe the Power Automate flow (with HTTP trigger) might be an option for me as I need the response parameters back to navigate the portal user accordingly (after custom logic) to the next screen.

  • Fubar Profile Picture
    8,487 Super User 2026 Season 1 on at

    @Sahil wrote:

    ......

    I believe that maybe the Power Automate flow (with HTTP trigger) might be an option for me as I need the response parameters back to navigate the portal user accordingly (after custom logic) to the next screen.


    Just be aware that the url for the Flow's HTTP trigger can be called publicly by default (i.e. you may need to add security to it).  Alternatively use the Portals Implicit Grant Flow https://docs.microsoft.com/en-us/power-apps/maker/portals/oauth-implicit-grant-flow

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
rezarizvii Profile Picture

rezarizvii 61

#2
Valantis Profile Picture

Valantis 46

#2
11manish Profile Picture

11manish 46

Last 30 days Overall leaderboard