Post

3 followers Follow
0
Avatar

data/countQuery InvalidOperation

In postman, I have:

{
"query": {
"entityquery" : {
"typeName" : "WorkItem",
"fields" : [ "name" ],
}
}
}

It throws:

"errorCode": "InvalidOperation"
"message": "Invalid operation: Could not convert {\r\n \"typeName\": \"WorkItem\",\r\n \"deleted\": false\r\n} to Query",
"referenceId": "3HEvymohy0Ltv0PI69ktlj"

I assume other fields are not required for the method request

Lnabong Answered

Please sign in to leave a comment.

6 comments

0
Avatar

Hi Lnabong,
Your message is wrongly constructed. Use EntityQuery directly (not under Query), Query is for CZQL query.
Hope this helps,
Ophir

Ophir Kenig 0 votes
Comment actions Permalink
1
Avatar

This is one of those API where you need to "hint" us which type you are talking about. In this example, the correct JSON should look like this:
(Note the "_type" property):

{
"query": {
"_type": "EntityQuery",
"typeName": "WorkItem"
}
}

Eyal Post 1 vote
Comment actions Permalink
0
Avatar

Great! thanks for the help.! About the "hint you which type.." will I encounter that again on the condition types?

Lnabong 0 votes
Comment actions Permalink