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)
  • developerAJ Profile Picture
    4,611 on at
    Error InvalidAuthenticationAudience when calling a Custom API from a Canvas App
    please provide a screenshot of auth tab from custom connector window

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

Coming soon: forum hierarchy changes

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 803 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 314 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 253 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics