REST API with API key from Azure Data Factory

Divakar Krishnan 106 Reputation points
2021-12-28T12:19:32.973+00:00

Dear Team,

I am pretty new to Azure Data Factory and API'.s

I have a requirement to load the data from external API to our Blob storage.

Our API structure follows the below.

API method URL: https://xxx-attendance
HTTP method: GET
X-API-Key: xyz==
Username: yyy
Password: zzz

****curl request**:**

curl -X GET "https://attendance" -H "accept: text/plain" -H "InitialLoad: true" -H "Username: xxx" -H "Password: yyy==" -H "X-API-Key: xyz"

I need to pass API key and user name / password to extract the files.

I tried to use REST API linked service, but I am not sure how to frame the base URL along with API key.

Can someone assist me on how to frame the base URL along with API key in REST API linked service or Web ?

Thanks,
P.K.Divakar

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
Microsoft Partner Center API
0 comments No comments
{count} votes

Answer accepted by question author
  1. Saurabh Sharma 23,866 Reputation points Microsoft Employee Moderator
    2021-12-28T22:30:19.733+00:00

    Hi @Divakar Krishnan
    Thanks for using Microsoft Q&A !!
    When you are using a web activity you can pass headers using the headers property from Web Activity Settings tab as shown below -
    160998-image.png

    Or you can pass headers as part of web activity dynamic content using the below properties in json

    "headers":{  
             "X-API-Key":"xyz"  
          },  
    

    Please refer to Web activity in Azure Data Factory for details.

    When you are using a REST API, you can configure authentication headers by using the json editor of the REST linked service and passing the required json properties -
    160984-image.png
    161005-image.png

    Please refer to the Using authentication headers section of REST documentation.

    Please let me know if you have any other questions.

    Thanks
    Saurabh

    ----------

    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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