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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to call external a...
Power Apps
Unanswered

How to call external api which has disabled CORS?

(0) ShareShare
ReportReport
Posted on by 115

Hi, 

I think there are 4 ways to access external API as below:

 1, an Azure function triggered by a webhook

 2, use xrm.webapi.online.execute method

 3, use a custom connector in a power automate flow

 4, a plug-in attached to a custom action called from JavaScript

but if the API disabled CORS, seems only the custom connector in flow could access the API. but WHY?...

Will all other ways  encounter the CORS error, and why?...

 

THANK YOU !!!

I have the same question (0)
  • Verified answer
    ChrisPiasecki Profile Picture
    6,422 Most Valuable Professional on at

    Hi @sukie_y,

     

    It's important to understand that CORS is not a security feature, it's a browser feature that relaxes security.. If CORS is disabled on an external API, then only requests that originate from the same domain (same origin policy ) as the API can be made. This only applies to scripts (e.g. JavaScript) running in the browser). It does not apply in non-interactive server to server scenarios. 

     

    You should not run into a CORS error if calling the Web API from a Dataverse Plugin, Azure Function, or Power Automate flow. If you're trying to call it from a JavaScript web resource in Dataverse (which you should not be doing anyway if any credentials are being passed) then you'd experience a CORS error if CORS is disabled on the external API. 

     

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

  • Ethan.s Profile Picture
    115 on at

    Hi @ChrisPiasecki 
    Thank you for the explain of CORS !!

    That's what I have be confused.

    Thank you !

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard