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 :
Microsoft Dynamics CRM (Archived)

How do you filter entities in the API versions 8.1 and before?

(0) ShareShare
ReportReport
Posted on by

I'm currently trying to filter entities by SchemaName and have been unsuccessful. 

In the API documentation Retrieve metadata by name or MetadataId the filtering syntax is listed as such: 

GET /api/data/v9.0/EntityDefinitions(LogicalName='account')

However, when I try and filter by an entity in this way I get the error: 

Bad Request - Error in query syntax

The only difference between my request url and their request url is they are on version 9.0. Is filtering available for earlier versions? When I try to use the version 9.0 I get the error: 

Requested API Version 'v9.0' is not available

Any ideas on why I am getting the filtering error and/or the versioning error? Thank you. 

*This post is locked for comments

I have the same question (0)
  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Hi,

    You are saying that you want to Retrieve the metadata in API versions 8.1 and before, but your API call above is using version 9, which is why you are getting the error.

    Change your API retrieve entity defitions to:

    GET /api/data/v8.1/EntityDefinitions(LogicalName='account')

    API is only available in version 8 or above.

    Hope this helps.

  • Community Member Profile Picture
    on at

    Hi there - that isn't the endpoint I am using, I was saying that is the endpoint from the documentation. When I change the endpoint to be 8.1, that is when I get the error "Bad Request - Error in query syntax". My question regarding v9.0 was that when I change the endpoint to be version 9.0 per the documentation, it gives me the separate error "Requested API Version 'v9.0' is not available".

  • Verified answer
    Community Member Profile Picture
    on at

    I found the answer to the filtering issue. The filtering parameter works if you structure the call as I did below. This returned an entity with the SchemaName of Account: 

    options.url = encodeURI(`${orgURI}/api/data/v8.1/EntityDefinitions?$filter=SchemaName eq 'Account'`)
  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    What version of Dynamics CRM are you using? Also, are you Online or On Premise?

    Your tags says Microsoft Dynamics CRM 4.0???

  • Community Member Profile Picture
    on at

    I can only access v8.1. There wasn't an '8.1' version as an option when creating the post, and I wasn't sure what to put and 4.0 sounded familiar because that's the OData version. 

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Just for your future reference, for 8.1 your should enter Dynamics CRM 2016. Version 8.1 is CRM 2016 Service Pack 1.

  • Community Member Profile Picture
    on at

    Gotcha, appreciate it - I will do that next time.

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 April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans