Hi,
Trying to build a payload to upsert multiple rows in this doc (zJTELzOhLB
) and target_table (grid-k6FW1e9ZIS
) using python and following https://coda.io/developers/apis/v1beta1#operation/upsertRows.
But I’m stuck at the first step, getting a 400 Client Error: Bad Request for url:
https://coda.io/apis/v1beta1/docs/zJTELzOhLB/tables/grid-k6FW1e9ZIS/rows
requests.get('https://coda.io/apis/v1beta1/whoami', headers=headers).json()
works so it’s not the API key.
And is it possible to update multiple rows in a single post: eg in the above target_table (grid-k6FW1e9ZIS
) & target_column (c-AOniRSX61x
), changing 1 to 100 and 22 to 99 with the lookup_column (c-_mQdN0yQZ0
) as the row key?
here’s the payload used in the request:
{"rows": [{"cells": [{"column": "c-AOniRSX61x", "value": "100.0"}, {"column": "c-w0SawZ6cB2", "value": ""}, {"column": "c-_mQdN0yQZ0", "value": "a"}, {"column": "c-AOniRSX61x", "value": "999.0"}, {"column": "c-w0SawZ6cB2", "value": ""}, {"column": "c-_mQdN0yQZ0", "value": "ccc"}, {"column": "c-AOniRSX61x", "value": "10001.990234375"}, {"column": "c-w0SawZ6cB2", "value": ""}, {"column": "c-_mQdN0yQZ0", "value": "bb"}]}], "keyColumns": ["c-_mQdN0yQZ0"]}
and payload indented:
{
“rows”: [
{
“cells”: [
{
“column”: “c-AOniRSX61x”,
“value”: “100.0”
},
{
“column”: “c-w0SawZ6cB2”,
“value”: “”
},
{
“column”: “c-_mQdN0yQZ0”,
“value”: “a”
},
{
“column”: “c-AOniRSX61x”,
“value”: “999.0”
},
{
“column”: “c-w0SawZ6cB2”,
“value”: “”
},
{
“column”: “c-_mQdN0yQZ0”,
“value”: “ccc”
},
{
“column”: “c-AOniRSX61x”,
“value”: “10001.990234375”
},
{
“column”: “c-w0SawZ6cB2”,
“value”: “”
},
{
“column”: “c-_mQdN0yQZ0”,
“value”: “bb”
}
]
}
],
“keyColumns”: [
“c-_mQdN0yQZ0”
]
}