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 :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Web API access token issue for some tables

(4) ShareShare
ReportReport
Posted on by
Hello,
 
I'm triggering the api "/api/data/v9.2/{table}/$count" for different tables and it works for many of them.
I'm using OAuth client credentials.
 
For some of them (e.g. gitorganizations), I'm getting:
 {"error":{"code":"0x80040216","message":"AccessToken not found. Please make sure plugin is registered as synchronous and not called with app credentials."}}

Do I need a different auth flow instead of client credentials? the problem is that my app is a non-interactive server app.
What options do I have?
 
Note that I'm using a developer environment without any plugins modifications/creations.
Categories:
  • Suggested answer
    Abdul Wahab Profile Picture
    on at
    Web API access token issue for some tables
    Why some tables work but others fail
    The error you see: "AccessToken not found. Please make sure plugin is registered as synchronous and not called with app credentials." is a Data-verse security model issue. With OAuth client credentials (app user), you’re authenticating as an application user, not a human user. That means you only get access to entities/tables that support application users. Some tables (like account, contact, systemuser, etc.) allow this fine. But some "special" tables (e.g. gitorganizations, activity tables, mailbox tables, or those that rely on user-context plugins) cannot be accessed with client credentials, because internally they try to resolve a real user access token. Instead of client credentials, authenticate as a real licensed user.
     
     
    Abdul Wahab
    Direct: +923323281237
    Email: abdulwahabubit@outlook.com
    LinkedIn: https://www.linkedin.com/in/abdul-wahab-a5b8b011a/
    Twitter: https://twitter.com/Abdulwahabubit
    GitHub: https://github.com/AbdulWahabWarind
    YouTube: https://www.youtube.com/channel/UCBjgLqLK_2kU-3bwo4McrTw
  • CU12081227-5 Profile Picture
    on at
    Web API access token issue for some tables
    Can you please provide instructions for user authentication? Also, my app is a server-app and it's not interactive, meaning I can't support 2FA.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans