Home>

When retrieving records with kintone's REST API,
Even if you set the search condition with query, you can not narrow down well.
I want to get the following records by specifying the date.

Array
(
[Record] =>Array
        (
            [Record number] =>Array
                (
                    [type] =>RECORD_NUMBER
                    [value] =>xx
                )
            [Updater] =>Array
                (
                    [type] =>MODIFIER
                    [value] =>Array
                        (
                            [code] =>xxxx
                            [name] =>xxxx
                        )
                )
            ...

            [Date] =>Array
                (
                    [type] =>DATE
                    [value] =>2019-12-04
                )
            ...
        )
)
curl -X GET "https: //xxxx/x/xx/records.json? app = xx" \
     -H "X-Cybozu-API-Token: xxxxxxxxxxxxxxxx" \
     -d '{"app": xx, "query": "date" = "2019-12-04"}'

With the above command, all records are returned from above without being narrowed down.

I think the reason is that the query specification method is wrong.
Reading the documentation and trying it out doesn't work.
How can I narrow it down?
I'd like someone professor.

  • Answer # 1

    kintone's REST API
    When sending parameters in JSON format (when setting JSON data in the request body of HTTP request)

    As far as

    is seen

    -d '{"app": xx, "query": "date" = "2019-12-04"}'is in JSON format (xxis assumed to contain a number).
    -d '{"app": xx, "query": "Date = \" 2019-12-04 \ ""}'Now