1

This question is about sending JSON payloads to a Web API Endpoint. I am using GridDB's web API to insert data into an existing table, via the PUT call. I am sending a JSON payload to be inserted into a table(container) as rows.

The HTTP PUT method is sent to a PATH of the form ":cluster/dbs/:database/containers/:container/rows"

( Ref:- http://www.toshiba-sol.co.jp/en/pro/griddb/docs-en/v4_3/GridDB_Web_API_Reference.html#ロウ登録 ) .

So, My PUT call goes to the prescribed HTTPS URL - https://cloud1.griddb.com/trialxxxx/griddb/v1/gs_clustertrialxxxx/dbs/test/containers/MyTable/rows

But I get an error :- {"version":"v2","errorCode":0,"errorMessage":"Rows data is empty"}

Do you see any problem in the JSON payload I am attaching with the PUT request ? My json file is here - https://docs.google.com/document/d/1rkpVPe9FJbRwSgyvv2oG5ms6ZCUijODN6-z_p8886I4/edit?usp=sharing Thanks Pratik

1 Answer 1

0

you're using the wrong datatype to send. if you look at the docs you sent, it expects an array of column values (this is their sample):

[
  ["2016-01-16T10:25:00.253Z", 100.5, "normal"],
  ["2016-01-16T10:35:00.691Z", 173.9, "normal"],
  ["2016-01-16T10:45:00.032Z", 173.9, null]
]

but you're sending an array of dictionaries. change your json to be just an array of values and it should work

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.