1

I am trying to get data from a REST API. According to the documentation, the API needs to have a date in the body like this:

{"date": "2023-01-05"}

It's working when I try it in Postman. When I try it in Azure Data Factory, it doesn't work.
I have a copy of data activity, the source is a Linked service REST API call. The necessary headers are inserted.

I have tried to insert the body in the additional headers, but that did not work.
My question is:
How/where can I insert the body of in the source of a copy data activity when the source is a REST API Linked service?

Here is a picture of the source in the copy activity and the error code I am getting

Error code:

Rest call failed with client error, status code 422 422, please check your activity settings. Request URL: https://api.gastroplanner.eu/booking/v1/bookings. Response: {"message":"The given data was invalid.","errors":{"date":["The date field is required when year month is not present."]}}

applesomthing
  • 361
  • 3
  • 19
Haroon
  • 15
  • 4
  • You have given `@item()` in your headers. that means you are running the copy activity inside a loop. Can you provide the value of it? and also can you provide a sample data from your REST API? – Rakesh Govindula May 04 '23 at 14:26
  • If you need to pass data on body, use HTTP POST instead of GET – jikuja May 04 '23 at 22:11

1 Answers1

0

Here, I tried to give the request body using Json directly while using GET request and it took it successfully as you see in below image. But when I tried to validate or publish it gave me error as below:

REST connector doesn't support GET requests with request body.

enter image description here

So, AFAIK to pass the request body you need to use post request.

You can raise the feature request for this feature here.

Pratik Lad
  • 4,343
  • 2
  • 3
  • 11