azureazure-data-factorymicrosoft-fabricazure-synapse-pipeline

REST API with Post Method as source in ADF Data flow


I am Trying to read data from an API source. Which works fine in Postman. Since I am not allowed to post images directly sharing them as link.

Postman_output

But the same fails when I try to read the Data from ADF data flow.

ADF_source_Settings

ADF_data_preview ERROR

I have already tried removing and adding all the headers, query parameters but it still fails. I also have other endpoints (GET method APIs) which works fine in ADF which implies that API is working fine. I don't think its necessary to post LS configurations.

Below is the request body.

    "title": "This is my report",
    "fields": [
        "employeeNumber",
        "preferredName",
        "fullName2",
        "firstName",
        "lastName"
    ]
}

Documentation for the source API's which I am using in my Data flow here: https://documentation.bamboohr.com/reference/request-custom-report

Below is the ERROR I get

at Source 'BAMBOOHRAPI': Failure to read most recent page request: DF-REST_001 - Error response from server: Some(), Status code: 400. Please check your request url and body. (url:https://api.bamboohr.com/api/gateway.php/<masked_value>/v1/reports/custom?format=JSON,request body: Some({"title":"BAmboo_employee_details","fields":["employeeNumber","fullName2","firstName","lastName"]}), request method: POST)

Not sure what is wrong here.


Solution

  • Seems Like the issue with additional header. I added Header

    --header 'content-type: application/json'
    

    In the Data flow source settings which resolved the issue and I am able to retrieve the Data from API