# When a query string contains some logic like Number \<=, and need part of app's fields, kintone will return "Illegal request".

**URL:** <https://forum.kintone.dev/t/when-a-query-string-contains-some-logic-like-number-and-need-part-of-apps-fields-kintone-will-return-illegal-request/323>\
**Category:** General\
**Created:** [June 12, 2020, 1:40am UTC](https://forum.kintone.dev/t/when-a-query-string-contains-some-logic-like-number-and-need-part-of-apps-fields-kintone-will-return-illegal-request/323 "2020-06-12T01:40:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [June 12, 2020, 1:40am UTC](https://forum.kintone.dev/t/when-a-query-string-contains-some-logic-like-number-and-need-part-of-apps-fields-kintone-will-return-illegal-request/323/1 "2020-06-12T01:40:34Z")

</div>

When a query string contains some logic like Number \<=, and need part of app’s fields, kintone will return “Illegal request”.

&nbsp;

For example:

&nbsp;kintoneApi.GetRecords(“18832”,&nbsp;“Number&nbsp;\<=&nbsp;3”,&nbsp;["$id"])

It will return “Illegal request”,

&nbsp;

kintoneApi.GetRecords(“18832”,&nbsp;“Number&nbsp;\<=&nbsp;3”)

It will get successfully. But it will get all the fields.

&nbsp;

We want to get part of app’s fields to improve performance.

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [June 13, 2020, 8:29pm UTC](https://forum.kintone.dev/t/when-a-query-string-contains-some-logic-like-number-and-need-part-of-apps-fields-kintone-will-return-illegal-request/323/2 "2020-06-13T20:29:48Z")

</div>

Hello,

Since the GetRecords function does not exist in the kintone API, it seems that you are using a function that executes the bulk record acquisition process “GET”, such as using the library.

We do not know the process inside the GetRecords function at this point, it is difficult to determine the cause of the error.

Please tell us the details of the process for executing “GET”, which is the bulk record acquisition process such as GetRecords function process. The language you are using, actual codes, etc.

Thank you

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [June 18, 2020, 9:17am UTC](https://forum.kintone.dev/t/when-a-query-string-contains-some-logic-like-number-and-need-part-of-apps-fields-kintone-will-return-illegal-request/323/3 "2020-06-18T09:17:48Z")

</div>

Sorry for unclear description, please create an app who has a field named “Number”, and some items in “Number” field are empty.

And then invoke the following code:

var&nbsp;body&nbsp;=&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;“app”:&nbsp;17330,  
&nbsp;&nbsp;&nbsp;&nbsp;“query”:&nbsp;‘(Number \< “10”)’,  
&nbsp;&nbsp;&nbsp;&nbsp;“fields”:&nbsp;[“Number”]  
};  
kintone.api(kintone.api.url(’/k/v1/records’,&nbsp;true),&nbsp;‘GET’,&nbsp;body,&nbsp;function(resp)&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;success  
&nbsp;&nbsp;&nbsp;&nbsp;console.log(resp);  
},&nbsp;function(error)&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;error  
&nbsp;&nbsp;&nbsp;&nbsp;console.log(error);  
});

An error with message "“Illegal request.” will be thrown.

But if condition is \>, it won’t throw the error:

var&nbsp;body&nbsp;=&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;“app”:&nbsp;17330,  
&nbsp;&nbsp;&nbsp;&nbsp;“query”:&nbsp;‘(Number \> “10”)’,  
&nbsp;&nbsp;&nbsp;&nbsp;“fields”:&nbsp;[“Number”]  
};  
kintone.api(kintone.api.url(’/k/v1/records’,&nbsp;true),&nbsp;‘GET’,&nbsp;body,&nbsp;function(resp)&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;success  
&nbsp;&nbsp;&nbsp;&nbsp;console.log(resp);  
},&nbsp;function(error)&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;error  
&nbsp;&nbsp;&nbsp;&nbsp;console.log(error);  
});

And if I try to get all fields with \< condition, it works well too:

var&nbsp;body&nbsp;=&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;“app”:&nbsp;17330,  
&nbsp;&nbsp;&nbsp;&nbsp;“query”:&nbsp;‘(Number \< “10”)’,  
&nbsp;&nbsp;&nbsp;&nbsp;“fields”:&nbsp;[]  
};  
kintone.api(kintone.api.url(’/k/v1/records’,&nbsp;true),&nbsp;‘GET’,&nbsp;body,&nbsp;function(resp)&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;success  
&nbsp;&nbsp;&nbsp;&nbsp;console.log(resp);  
},&nbsp;function(error)&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;error  
&nbsp;&nbsp;&nbsp;&nbsp;console.log(error);  
});

&nbsp;

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [June 22, 2020, 3:42am UTC](https://forum.kintone.dev/t/when-a-query-string-contains-some-logic-like-number-and-need-part-of-apps-fields-kintone-will-return-illegal-request/323/4 "2020-06-22T03:42:46Z")

</div>

Linner

Thank you for your post. This looks like a potential bug - we’ve notified the Kintone Dev team to check on this.

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [June 24, 2020, 12:57pm UTC](https://forum.kintone.dev/t/when-a-query-string-contains-some-logic-like-number-and-need-part-of-apps-fields-kintone-will-return-illegal-request/323/5 "2020-06-24T12:57:44Z")

</div>

Linner

This bug has now been fixed. Thank you for submitting your issue!

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [June 29, 2020, 9:31am UTC](https://forum.kintone.dev/t/when-a-query-string-contains-some-logic-like-number-and-need-part-of-apps-fields-kintone-will-return-illegal-request/323/6 "2020-06-29T09:31:19Z")

</div>

William,

Thanks very much!
