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

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

 

For example:

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

It will return “Illegal request”,

 

kintoneApi.GetRecords(“18832”, “Number <= 3”)

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

 

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

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

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 body = {
    “app”: 17330,
    “query”: ‘(Number < “10”)’,
    “fields”: [“Number”]
};
kintone.api(kintone.api.url(’/k/v1/records’, true), ‘GET’, body, function(resp) {
    // success
    console.log(resp);
}, function(error) {
    // error
    console.log(error);
});

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

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

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

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

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

 

Linner

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

Linner

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

William,

Thanks very much!