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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Audit api(/api/data/v9.0/audits) for Microsoft Dynamics online gives error when expand=userid parameter is used

(0) ShareShare
ReportReport
Posted on by 5

Hi,

I am using the Microsoft dynamics Audit API https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/audit?view=dynamics-ce-odata-9

When i use the userid property(listed under Single value navigation property) it does not work and gives this 400 error:

Request <instanceurl>/api/data/v9.0/audits?$expand=userid

{"error":{"code":"0x80040216","message":"Only inner join is supported for Audit query."}}

Can somebody help get a solution to this or suggest an alternative to fetch the useremail address for the audit entry created?

Thanks,
Sheetal

I have the same question (0)
  • Suggested answer
    Guido Preite Profile Picture
    54,086 Moderator on at

    Sadly not all relationships can be expanded (or filtered) using the WebAPI tables. You can eventually try to create a fetchxml (using FetchXML Builer inside XrmToolBox) and execute the fetchxml with Web API (you can eventually use my tool Dataverse REST Builder, link in my signature, to generate the code, the action is Predefined Query).
    If is not possible with fetchxml (or you don't want to use it) the alternative is to do a second request to the systemuser table to fetch the columns based on the id you get from the first query.

    hope it helps

  • Shashidhar Sam Profile Picture
    5 on at

    Hi Guido,

    Thanks for the reply.

    Making an additional call for mapping every userid seems to be a bit expensive for our use case.

    However, it is weird that the query parameter used to work some time back and as mentioned in the document it is a single navigation property, hence assuming expand parameter should be working now too.

    However, the expand=userid parameter suddenly stopped working and started throwing the 400 error.

    Any help on understanding why this feature suddenly stopped working and an easier alternative to fetch the userid of the audit change,  would be of much help!

    Thanks,

    Sheetal Shetty

  • Guido Preite Profile Picture
    54,086 Moderator on at

    as I wrote before you can try with a fetchxml query, however if your users are less than 5000, you can do a single query to the systemuser table and cache the results, it's an alternative you have

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 184 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 138

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans