Azure Data Factory - Copy Activity REST API (as sink) Error "The body must be an object"
I am using Copy Activity to read data from a Table and sending the output rows to a REST API via POST request. While doing so i get an error on sink side:
"status": { "code": 300, "message": "INVALID_OR_MISSING_REQUEST" }, "errors": [ { "code": "body", "message": "The body must be an object." } ] },Source=Microsoft.DataTransfer.ClientLibrary,'
When i import schema, it automatically maps the columns for me as below:
Problem seems to be in how ADF is formatting output vs how REST endpoint expects data. I tried to manually send JSON data from a Web Activity that works:
{
"users": [
{
"firstName": "Test",
"lastName": "Test",
"email": "******@abc.com",
"phone": "88888888",
"userId": "88888888",
"Points": "1111",
"Month": "February"
}
]
}
To test copy activity output JSON format, i tried sending data to a logic app endpoint and format seems to be different than expected by API endpoint:
"body": [
{
"firstName": "Test",
"lastName": "Test",
"email": "******@abc.com",
"phone": "88888888",
"userId": "88888888",
"Points": "1111",
"Month": "February"
}
]
What do i need to do to map it correctly.