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

WebAPI Request to filter on modifiedon date and time

(0) ShareShare
ReportReport
Posted on by 10

Hello Community,

I try to request data via WebApi from our CRM System (New/modified entry of the last 15 minutes). The URL looks like this:

https:/url-of-company.com/api/data/v9.2/accounts?$filter=modifiedon%20le%20'2022-02-22T10:51Z'%20and%20modifiedon%20ge%20'2022-02-22T10:36Z'

I retrieve a Server Error 400 - the research I have done and the solutions I found were not quite clear.

Maybe someone can help me out.

Best,

Sven

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

    the datetime operators you are using don't need the single quote (') before and after the value, also the time value is not the one you usually receive (but should work) so your url should look like this one:

    https:/url-of-company.com/api/data/v9.2/accounts?$filter=modifiedon%20le%202022-02-22T10:51:00.000Z%20and%20modifiedon%20ge%202022-02-22T10:36:00.000Z

    if you need to build and test such queries you can use Dataverse REST Builder (you can find the link inside my signature)

    hope it helps

  • iosven Profile Picture
    10 on at

    Hello Guido,

    thanks for you reply, but the error 400 still persists.

    My URL looks now like this: company-url.dynamics.com/.../EntityDefinitions

    I tried using Datavers REST Builder, but I was not able to get a connection to the Dataverse even if it looks like a  connection was established once.

    Thanks and all the best,

    Sven

  • Guido Preite Profile Picture
    54,086 Moderator on at

    EntityDefinitions is an endpoint to get the metadata, not actual records.

    Keep in mind that Dataverse REST Builder is available as XrmToolBox tool and if doesn't work inside XrmToolBox you can install it inside your instance as managed solution. inside the repo readme there is a youtube video and a blog post link on how to install and use it.

    Error 400 means bad request, usually means that the url is not written correctly

    hope it helps

  • iosven Profile Picture
    10 on at

    Hi,

    sorry, my fault:

    company-url.dynamics.com/api/data/v9.2/EntityDefinitions?$filter=modifiedon le 2022-02-22T12:26:00.000Z and modifiedon ge 2022-02-22T12:11:00.000Z

    I tried to use it with Visual Studio Code.

    BR,

    Sven

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 162 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 134

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 55 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans