Post Record to a Kintone App Using Postman (X-Cybozu-API-Token)

Dear Developers,

Currently, I have trouble creating a record to a kintone app using POST record in a postman, while I have no problem when Get Records, but when creating a record, its response was like this:

{
"code": "CB_IL02",
"id": "HhAhXmFFOy9XlTLgKWQt",
"message": "不正なリクエストです。"
}

The message translated as “Invalid request.”

My header is like this:

X-Cybozu-API-Token: 3a2zV...
Content-Type: application/json

The URL I used is like this, based on the Post Record documentation on the Kintone developer

https://sub-domain.kintone.com/k/v1/record.json?app=1007

Where app=1007 is the Params required.

This Post Record is actually succeeded when I used X-Cybozu-Authorization, but I didn’t want to use username:password, I wanted to use the token I configured on the app instead of the other one.

Please help; any answer would be so appreciated.

Thank you very much.

Dear Developers,

I just found how to make it work using Postman, you need to put the app (APP_ID) inside the Body , not in the Params , and then, instead of using form-data , you need to use raw. So things that required are:

  • Headers: X-Cybozu-API-Token (value is the token generated from the app you want to create a record there) and Content-Type: application/json

  • Body (raw), fill with something like this:

    {
    app: 1007,
    record: {
    Field_Name: {
    value: ‘Your_Field_Value’
    },
    // Other field name and value here, delete this comment line
    }
    }

The response now should tell you different messages, like you need to fill the required field that cannot be null, something like this.

{
"code": "CB_VA01",
"id": "eYIulRwEM1ioO1moloPE",
"message": "入力内容が正しくありません。",
"errors": {
"record.JobRequest.value": {
"messages": [
"必須です。"
]
},
"record.CandidateName.value": {
"messages": [
"必須です。"
]
}
}
}

The success response would be like this

{
"id": "2",
"revision": "1"
}

I think that is all, thank you

In case of API Tokens, the language of the messages that are returned depend on the language settings of the domain.

This can be set by accessing the Localization settings in the Users & System Administration page _ https://{subdomain}.kintone.com/admin/localization _