データローダWebAPI・レコード初期化
イベントデータ挿入用の空の json を返却します。対象のイベントデータ構造を取得するためにも使うことができます。
エンドポイント
https://pf.xdata.nict.jp/api/v1/dataloaderapi/jsonrpc
リクエスト例
下記は loaderwebapi.register_loaderを使って test_event_001 という名前で data_nameを定義した場合のリクエストになります。
{
"id": 1,
"jsonrpc": "2.0",
"method": "loaderwebapi.init_record",
"params": {
"data_name": "test_event_001",
"record_set_size": 2
}
}
レスポンス例
下記は上記のリクエスト内容での返却内容になります。
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"features": [
{
"geometry": null,
"properties": {
"start_datetime": null,
"end_datetime": null,
"test_varchar_1": null
},
"type": "Feature"
},
{
"geometry": null,
"properties": {
"start_datetime": null,
"end_datetime": null,
"test_varchar_1": null
},
"type": "Feature"
}
],
"type": "FeatureCollection"
}
}
パラメータ
JSON-RPCリクエスト内容のうち、params 内に指定可能なものを下記に表示します。 すべて必須パラメータです。
data_name
: データを挿入したいテーブルを指し示す名前。loaderwebapi.register_loaderで指定したものを使う。record_set_size
: 戻り値の配列のサイズ
戻り値
loaderwebapi.add_record に渡す GeoJson の雛形を返す。
features
の要素数は record_set_size
によって指定された値となる。
features
の各要素の properties
には、指定されたデータが持ちうる属性すべてのうち geometry
属性以外のキーが含まれている。
geometry
及び各属性の値はいずれも null。