Skip to main content

Notifications

Community site session details

Community site session details

Session Id : zMc2wNUHCwzCUY3m26zIeo
Power Pages - General Discussions
Answered

How to call external Api(custom api in dynamics 365) from power app portal(power pages).

Like (0) ShareShare
ReportReport
Posted on 7 Apr 2023 05:16:20 by

Hi everyone, I'm trying to call custom API which I created in solution from power pages. as I have followed Microsoft docs for creating site settings and created app registration in AAD as well still I'm not able to get chances of calling it. Can someone please guide me on how to call api from power pages.

Note: In some references they say to get auth token from portal by <portal_url>/_services/auth/token by pasting url in browser. But for me I never got the token from portal. Is there any configurations  

 

References: https://learn.microsoft.com/en-us/power-pages/security/oauth-implicit-grant-flow

 

Categories:
  • Community Power Platform Member Profile Picture
    on 20 Apr 2023 at 11:12:10
    Re: How to call external Api(custom api in dynamics 365) from power app portal(power pages).

    Thank you @KH_2437 

  • Verified answer
    Peragin Profile Picture
    160 on 18 Apr 2023 at 17:23:59
    Re: How to call external Api(custom api in dynamics 365) from power app portal(power pages).

    Hi @Anonymous ,

     

    Hopefully, this may help.

  • Community Power Platform Member Profile Picture
    on 11 Apr 2023 at 04:40:01
    Re: How to call external Api(custom api in dynamics 365) from power app portal(power pages).

    Thank you @KH_2437 that was so good information. I tired to to a post request using token url from browser console but I'm getting 404 not found error. But can you please shed some light on APIM? I'm bit curious about this. Because I'm bit new to these and I'm not sure how to validate token in APIM and JWT validate in inbound policies. How to do these things. This will help a lot

  • Peragin Profile Picture
    160 on 07 Apr 2023 at 12:51:16
    Re: How to call external Api(custom api in dynamics 365) from power app portal(power pages).

    Hi @Anonymous 

     

    I believe <portal_url>/_services/auth/token only support post now and the browser uses get. You will need to go into the console on the browser and call the post action from there.

     

    When it comes to authentication, using APIM to call your custom API, will allow you validate the power pages token in APIM using JWT validate in the inbound policies. Better to extract the username from the token with in the policy and pass it to your custom API for any authorizations you may need in the custom API.

     

    A question that's probably worth asking though, is it really necessary to use a custom api? You will need to use client side javascript to do so and this carries it's own concerns of where users can manipulate it at the browser. Power pages works best with the data is on dataverse, is it a possibility to copy the required data to there?

     

    Or wait for the new feature due for release to preview shortly where one can call a Power Automate flow that can then call your custom API from power pages. Not sure what the lag will be like on this but if it's fast, it will be very promising for simplifying the whole area. Use cloud flows with Power Pages sites 

     

    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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,695 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard
Loading started