Azure Data Factory - WEB activity output won't return JSON

431 Views Asked by At

I am consuming a SENGRID API SENDERS trying to do a GET request (https://api.sendgrid.com/v3/marketing/senders) and the output is not returning in JSON format.

This is an example of how the data is returning on ADF:

"[{\"id\":1111111,\"nickname\":\"Marketing\",\"from\":{\"email\":\"[email protected]\",\"name\":\"Marketing\"},\"reply_to\":{\"email\":\"[email protected]\",\"name\":\"\"},\"address\":\"sometext\",\"address_2\":\"\",\"city\":\"sometext\",\"state\":\"\",\"zip\":\"00000\",\"country\":\"ABC\",\"verified\":{\"status\":false,\"reason\":null},\"updated_at\":1111111,\"created_at\":111111,\"locked\":false}]\n"

I have tried other APIs and they return JSON, but in this case it's different. I have also tried the API that I am having problems with on Postman it returns a JSON, but I don't know why it'ss not working on ADF.

1

There are 1 best solutions below

1
On BEST ANSWER

As per this Documentation, currently web activity in ADF does not support JSON arrays as response.

enter image description here

That is why it is returning the JSON array as a string. I have tried with a sample JSON array and you can see it returned it as JSON string.

enter image description here

As a workaround, to get the above string as a JSON array, use @json() on the web activity output response string.

@json(activity('Web1').output.Response)

This will convert the JSON string as JSON. For sample I am storing this in an array variable.

enter image description here

Result:

enter image description here