A simple Pipeline created to fetch data by querying the Rest Api and dumping the data received in blob storage, failed with following error:
Error
Operation on target Copy data_From API failed: Failure happened on 'Source' side. ErrorCode=UserErrorHttpStatusCodeIndicatingFailure,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=The HttpStatusCode 400 indicates failure. {"errors":{"detail":"Internal server error"}},Source=Microsoft.DataTransfer.ClientLibrary,'
Why it happened
As the error says, something went wrong at source side however, I have tested the Rest API using postman and was able to get the response back with data.
And I have reflected same in Source setting of Copy Data activity while creating the pipeline i.e. query, headers – content type and authorization etc
Still getting the error, I rechecked again the keys,content type etc - no clue.
Took help from colleague and she pointed out the issue, it was with the way the query was posted. The rest api expects Graphql query, she asked me to check code view in postman and the issue was found.
What to do
{"query": "{clients {id}}"}
That's it, all worked fine then after.