Error updating a record in a datatable

Hello all. I have a datatable with a couple of fields. The datatable has a few test rows in it. ANI is the key field and Callback is a string field.

I get an error when doing a PUT to /api/v2/flows/datatables/{datatableid}/rows/{rowid}

Here's an example:
/api/v2/flows/datatables/38a9b56e-7ae0-4509-858c-526b920b6dec/rows/789

JSON Body:
{ "CallbackNumber" : "12345" }

{
"message": "'' is too short\n\nFailed validating 'minLength' in schema['properties']['key']:\n {'$id': '/properties/key',\n 'displayOrder': 0,\n 'maxLength': 256,\n 'minLength': 1,\n 'title': 'ANI',\n 'type': 'string'}\n\nOn instance['key']:\n ''",
"code": "flows.datatables.schema.exception",
"status": 400,
"messageParams": {},
"contextId": "f52cb350-9370-4a7c-85d3-eab490a2c52a",
"details": [],
"errors": []
}

What's interesting is that if I change the JSON Body (see below) it works:
{ “Key”: “789”, "CallbackNumber" : "12345" }

If I need to pass the rowid in the JSON body then why do I need to pass the value in the URL?

Thank you,
Felice

Hello Felice,

That's per design of this API endpoint.
The Key has to be sent in the request body as well.

See the description of this API Endpoint (In the Developer Tools and here):
"Updates a row with the given rowId (the value of the key field) to the new values. The DataTableRow should be a json-ized' stream of key -> value pairs { "Field1": "XYZZY", "Field2": false, "KEY": "27272" }"

Regards,

Thank you for the update.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.