Skip to content

dataset.record.put

Note

This document has been machine translated.

Registers or updates a record in a data set.

Parameters

  • dataset_name: string -- dataset name.
  • records: array -- An array of records to register or update. The values must be in the order defined in the dataset.
  • on_conflict: string -- What to do if a record already exists. You can specify one of error, update, or nothing string. This item can be omitted. If it is omitted, error is returned.
    • error -- If the record already exists, an error is returned. No other records will be registered.
    • update -- if the record already exists, update its contents.
    • nothing -- If the record already exists, do nothing and skip it. Other records will be registered.

Return Values

Returns the number of records registered or updated in the dataset.

Execution example

Request Data

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "dataset.record.put",
    "params": {
      "dataset_name": "my_dataset",
      "records": [
        [1, "石塚 洋次", "WzxKRGR6J@sample.com"],
        [2, "近藤 恭之", "KefD6KU@test.net"],
        [3, "玉井 真帆", null]
      ],
      "on_conflict": "error"
    }
}

Request Execution

curl -H "Content-type: application/json" \
     -H "APIKey: 9c6f4574-89d1-4e3c-8af7-2549dc217fcf" \
     -H "Secret: aef8caingiej1ieNieJ3Phool4maeGohcies" \
     -X POST -d "@request.json" \
     https://localhost/api/v2/dataset/jsonrpc

Response

{
  "result": 3,
  "id": 1,
  "jsonrpc": "2.0"
}