Web API is not connecting using Token

Atul Kumar 91 Reputation points
2023-05-23T00:31:41.72+00:00

Hi Team,

 I am trying to create a ADP Pipeline to connect to Web API using Provided Token. It is a POST request with passing parameters in Body section. 

 But I am getting error every time I execute the Pipeline: <error>You do not have permissions to use the API</error>

 Parameters passed :

 

token='xxxxxxxxxx',
content='report',
format='csv',
report_id='xx44x',
csvDelimiter='',
rawOrLabel='label',
rawOrLabelHeaders='raw',
exportCheckboxLabel='false',
returnFormat='csv

 

When I try to connect using Postman site with application/x-www-form-urlencoded, it works well and returns the data set.

 

Am I missing anything in ADF? Please help.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,637 questions
{count} votes

1 answer

Sort by: Most helpful
  1. VasimTamboli 5,215 Reputation points
    2023-05-23T13:14:56.4133333+00:00

    Check the token format: Confirm that the token format you are using in ADF matches the expected format by the Web API. Different APIs may require tokens in different formats (e.g., JWT, OAuth). Verify that the token format is correct and matches the requirements of the Web API.

    Review the authentication method: Ensure that you are using the correct authentication method in ADF to pass the token. Some APIs may require specific authentication methods such as bearer token authentication or OAuth2. Verify that you are using the appropriate authentication method for the Web API.

    Test with Postman configuration: Since you mentioned that the token works fine when testing with Postman, compare the configuration used in Postman (headers, body parameters, content type, etc.) with the configuration in ADF. Make sure all the necessary headers and parameters are included and match the ones used in Postman.

    Check the ADF pipeline configuration: Review the ADF pipeline configuration to ensure that the token is correctly passed to the Web API. Double-check the body section and ensure that the parameters are properly defined and formatted.

    Debug the request: Enable debugging or logging in ADF to gather more information about the request and response. This can help identify any potential issues or discrepancies between the request made by ADF and the successful request made by Postman.

    If you have verified all these aspects and the issue still persists, it would be helpful to provide more details about the Web API and the specific configuration in ADF.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.