Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SantoshKumar
Employee
Employee

How to refresh web Api when it has Header and Key values in the sources (web Link)

Hi All,

 

I have below content as my source:
Source =

Json.Document(

             Web.Contents(

                              "https://abcd.azurewebsites.net/api/CompatAPI/GetVSOItemsByQueryId?queryId=abcd-efgh-ijh",[Headers=[key="abcdefgh12345678"]])),

 

and i have checked the link "Chris Webb's BI Blog: Using The RelativePath And Query Options With Web.Contents() In Power Query An..."

 

but it does not provide any conditions related to my request which has queriId and Header with Key.

Can anyone provide any lead on how to change my source to make it error free to schedule refresh.

 

Regards

Santosh Kumar P

1 ACCEPTED SOLUTION
SantoshKumar
Employee
Employee

Issue : 

Source =Json.Document( Web.Contents(                              "https://abcd.azurewebsites.net/api/CompatAPI/GetVSOItemsByQueryId?queryId=abcd-efgh-ijh",[Headers=[key="abcdefgh12345678"]]))

 

i have went through few videos in the youtube and noticed that for all web API contents everyone has provided query links in BASIC mode where as i have provided query in Advanced mode.
so, i have modified my query to make is consume data with BASIC mode only.
previous steps i followed is 

1. go to advance mode

2. provide query string in URl

3. key in Header
Current way:

1.append query in Basic mode only as below:

Source =Json.Document( Web.Contents(

                              "https://abcd.azurewebsites.net/api/CompatAPI/GetVSOItemsByQueryId?queryId=abcd-efgh-ijh&key=abcdefgh12345678"))

then after i went to Settings Data set and Edit Credentials,choose Anonymous and Save.

Then my issue got resolved.

View solution in original post

3 REPLIES 3
SantoshKumar
Employee
Employee

Issue : 

Source =Json.Document( Web.Contents(                              "https://abcd.azurewebsites.net/api/CompatAPI/GetVSOItemsByQueryId?queryId=abcd-efgh-ijh",[Headers=[key="abcdefgh12345678"]]))

 

i have went through few videos in the youtube and noticed that for all web API contents everyone has provided query links in BASIC mode where as i have provided query in Advanced mode.
so, i have modified my query to make is consume data with BASIC mode only.
previous steps i followed is 

1. go to advance mode

2. provide query string in URl

3. key in Header
Current way:

1.append query in Basic mode only as below:

Source =Json.Document( Web.Contents(

                              "https://abcd.azurewebsites.net/api/CompatAPI/GetVSOItemsByQueryId?queryId=abcd-efgh-ijh&key=abcdefgh12345678"))

then after i went to Settings Data set and Edit Credentials,choose Anonymous and Save.

Then my issue got resolved.

amitchandak
Super User
Super User

@amitchandak the information which you have provided is regarding how to provide key value to Web API.
here i have already provided those things and my data is flowing as expected.
my problem here is that "with the format which appear, i am not able to schedule refresh". i went through few links and found that it should be changed certain format (mentioned in my query) but those links does not deals with "Web Content with Advanced option data".

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.