I am trying to implement google automl api: https://cloud.google.com/automl-tables/docs/predict
The api docs says I need to post data in following format:
{
"payload": {
"row": {
"values": [value1, value2,...]
}
}
}
But when I to post data in same format I get the following error:
{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name \"row\" at 'payload': Cannot find field.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "payload",
"description": "Invalid JSON payload received. Unknown name \"row\" at 'payload': Cannot find field."
}
]
}
]
}
}
Here is my curl request:
curl --location --request POST 'https://automl.googleapis.com/v1/projects/project-id/locations/us-central1/models/TBLID:predict' \
--header 'Content-Type: application/json; charset=utf-8;' \
--header 'Accept-Charset: utf-8' \
--header 'Authorization: Bearer token here' \
--data-raw '{
"payload": {
"row": {
"values": [
"",
"4.900000",
""
]
}
}
}'
I am not sure what is causing this error. Can anyone help with this problem thanks