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)

Bad Request - Error in query syntax in "EntityDefinitions" entity in on-premises

(1) ShareShare
ReportReport
Posted on by

Hi,

www.abc.com/api/data/v8.0/EntityDefinitions(LogicalName='task')/Attributes

Using above URL I'm getting all attributes of a task by logical name in ONPREMISES but it gives me an error. 

{
  "error":{
    "code":"","message":"Bad Request - Error in query syntax.","innererror":{
      "message":"Bad Request - Error in query syntax.","type":"Microsoft.OData.Core.ODataException",
"stacktrace":" at Microsoft.OData.Core.UriParser.Metadata.ODataUriResolver.ResolveKeys
(IEdmEntityType type, IDictionary`2 namedValues, Func`3 convertFunc)\r\n
at Microsoft.OData.Core.UriParser.Metadata.AlternateKeysODataUriResolver.ResolveKeys(IEdmEntityType type,
IDictionary`2 namedValues, Func`3 convertFunc)\r\n
at Microsoft.OData.Core.UriParser.Parsers.SegmentArgumentParser.TryConvertValues(IEdmEntityType targetEntityType,
IEnumerable`1& keyPairs, ODataUriResolver resolver)\r\n
at Microsoft.OData.Core.UriParser.Parsers.SegmentKeyHandler.CreateKeySegment(ODataPathSegment segment,
KeySegment previousKeySegment, SegmentArgumentParser key, ODataUriResolver resolver)\r\n
at Microsoft.OData.Core.UriParser.Parsers.SegmentKeyHandler.TryCreateKeySegmentFromParentheses
(ODataPathSegment previous, KeySegment previousKeySegment, String parenthesisExpression,
ODataPathSegment& keySegment, Boolean enableUriTemplateParsing, ODataUriResolver resolver)\r\n
at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.TryBindKeyFromParentheses(String parenthesesSection)
\r\n at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.TryCreateSegmentForNavigationSource(String
identifier, String parenthesisExpression)\r\n at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.
CreateFirstSegment(String segmentText)\r\n at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.
ParsePath(ICollection`1 segments)\r\n at Microsoft.OData.Core.UriParser.Parsers.ODataPathFactory.BindPath
(ICollection`1 segments, ODataUriParserConfiguration configuration)\r\n at Microsoft.OData.Core.UriParser.
ODataUriParser.Initialize()\r\n at System.Web.OData.Routing.DefaultODataPathHandler.Parse(IEdmModel model,
String serviceRoot, String odataPath, ODataUriResolverSetttings resolverSettings, Boolean
enableUriTemplateParsing)\r\n at System.Web.OData.Routing.DefaultODataPathHandler.Parse(IEdmModel model,
String serviceRoot, String odataPath)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataPathHandler.Parse
(IEdmModel model, String serviceRoot, String odataPath)" } } }


can anybody suggest me what is a concern here?

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    I'm getting the same error, I'd be interested in knowing. If I remove the filter it works perfectly, but I get this error each time I use filters on any of the metadata item endpoints. It doesn't work as a query param either.

  • Suggested answer
    Community Member Profile Picture
    on at

    I wonder if it has to do with the API version. Because you are using v8.0 and I am using v8.1 but the API docs say to use v8.2, but I get an error when I use that version.

  • Suggested answer
    Community Member Profile Picture
    on at

    Try this structure when filtering (this is for an entity with the SchemaName of Account):

    options.url = encodeURI(`${orgURI}/api/data/v8.1/EntityDefinitions?$filter=SchemaName eq 'Account'`)
    

    That worked for me. 

    So in your case it should work like: 

    options.url = encodeURI(`www.abc.com/api/data/v8.0/EntityDefinitions?$filter=LogicalName eq 'task'`)


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

    I just tried the following with CRM Online and CRM On-Premise (v8.2):

    xyz.crm.dynamics.com/.../EntityDefinitions(LogicalName='task')/Attributes

    xyz.domain.com/.../EntityDefinitions(LogicalName='task')/Attributes

    and they both work and return all the data.

    What version and service pack exactly are you of Dynamics CRM?

    You can find it in Personal Settings -> About.

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