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

Community site session details

Session Id :
Power Apps - Power Query
Unanswered

Error InvalidAuthenticationAudience when calling a Custom API from a Canvas App

(0) ShareShare
ReportReport
Posted on by

Hello, we are getting this error when calling a Custom API in our dev environment:

"response": {
          "error": {
            "code": "InvalidAuthenticationAudience",
            "message": "The received access token has been obtained from wrong audience or resource 'https://xxx.crm4.dynamics.com/'. It should exactly match (including forward slash) with one of the allowed audiences 'https://service.powerapps.com/','https://apps.powerapps.com','https://apps.powerapps.com/','https://apihub.azure.com','https://api.powerplatform.com'."
          }
        }
 
"_serviceType": "connector",
      "_suggestedErrorMessage": {
        "message": "One or more of your connections may not be authenticated. Please restart the app to fix this."
      },
      "_diagnosticMessage": "The received access token has been obtained from wrong audience or resource 'https://xxx.crm4.dynamics.com/'. It should exactly match (including forward slash) with one of the allowed audiences 'https://service.powerapps.com/','https://apps.powerapps.com','https://apps.powerapps.com/','https://apihub.azure.com','https://api.powerplatform.com'."
    }
 

The Power FX code is:

Environment.book_api(
            {
                qId: Quote.Quote,
                qoId: Option.'Quote Product',
                bill: varBill
            }
        );
 

Our environment is in North Europe, which should not have an impact.

Categories:
I have the same question (0)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Power Apps

Last 30 days Overall leaderboard

Featured topics