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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
mehaboob557
Resolver IV
Resolver IV

Need to get the data which has OAUTH1

Hi All,

 

I have to get the data(XML data) which is having the OAUTH 1.0 Authorization.

 

Please le mw know how can i call the API with Oauht 1,o authorization, consuumerkey, and so on.

 

Authorization =  OAuth oauth_consumer_key="MYTGRSFEJXB2EUIYHKSOZ905ST6",oauth_token="XW0IPKSYZIUHNCNRHEYHZCVCO2XJ",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1513672566",oauth_nonce="ZOxR3R",oauth_version="1.0",oauth_signature="dv%2FWowNk2mYAAgmWKnJPcJr6f7s%3D"

 

Some URL = "https://someurl.com/contacts"

 

How can i use the above and where should i call to get the data in powerBI desktop data source.

 

Thanks a lot in advance

 

1 ACCEPTED SOLUTION

Hi ,

 

let

Source = Xml.Tables(Web.Contents("URL", [Headers=[#"Authorization"="OAuth oauth_consumer_key=""YOURKEY"", oauth_nonce=""YOURCODE"", oauth_signature=""YOURSIGNATURE"", oauth_signature_method=""HMAC-SHA1"", oauth_timestamp=""YOURTIMESTAMP"", oauth_token=""YOURTOKEN"", oauth_version=""1.0"""]]
),null,65001)

in

Source

 

As the error message prompted, the authentication type is not set to Anonymous. To modify the setting, navigate to File > Options and settings > Data source settings. Find your data source URL from the list, click Edit, edit the credential type to be Anonymous, and click Done. Please try again.

 

 

View solution in original post

6 REPLIES 6
v-yuezhe-msft
Employee
Employee

@mehaboob557,

Have you checked the sample code in the following blog? But please note that ithe code will only work for a small period of time until the token is invalid again, you would need to refresh the token and add the right value to the header.

let

Source = Web.Contents("URL", [Headers=[#"Authorization"="OAuth oauth_consumer_key=""YOURKEY"", oauth_nonce=""YOURCODE"", oauth_signature=""YOURSIGNATURE"", oauth_signature_method=""HMAC-SHA1″", oauth_timestamp=""TIMESTAMP"", oauth_token=""YOURTOKEN"", oauth_version=""1.0"""]]
)
in
Source



Regards,
Lydia

 

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yuezhe-msft 

Hi Lydia, I have read your post.

I do have all the necessary parameters: realm, consumer key, consumer secret, token id, token secret...

And my call works in Postman.

It somehow automatically generates from my parameters - his own: oauth_signature, oauth_nonce anf timestamp...

How do I generate them in Power Query?

Thanks!

I am facing this error

 

ertyu.PNG

 

 

Please help me how can i over come this?

@mehaboob557,

Add a new blank query in Power BI Desktop, paste the following code to the Advanced Editor of the blank query, please replace required keys with your owns, then check if you get any error. In addition, do mask sensitive data when you upload screenshots.

let

Source = Xml.Tables(Web.Contents("URL", [Headers=[#"Authorization"="OAuth oauth_consumer_key=""YOURKEY"", oauth_nonce=""YOURCODE"", oauth_signature=""YOURSIGNATURE"", oauth_signature_method=""HMAC-SHA1"", oauth_timestamp=""YOURTIMESTAMP"", oauth_token=""YOURTOKEN"", oauth_version=""1.0"""]]
),null,65001)

in

Source



Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi ,

 

let

Source = Xml.Tables(Web.Contents("URL", [Headers=[#"Authorization"="OAuth oauth_consumer_key=""YOURKEY"", oauth_nonce=""YOURCODE"", oauth_signature=""YOURSIGNATURE"", oauth_signature_method=""HMAC-SHA1"", oauth_timestamp=""YOURTIMESTAMP"", oauth_token=""YOURTOKEN"", oauth_version=""1.0"""]]
),null,65001)

in

Source

 

As the error message prompted, the authentication type is not set to Anonymous. To modify the setting, navigate to File > Options and settings > Data source settings. Find your data source URL from the list, click Edit, edit the credential type to be Anonymous, and click Done. Please try again.

 

 

Thanks Lydia,

 

Where should i add this

 

let

Source = Web.Contents("URL", [Headers=[#"Authorization"="OAuth oauth_consumer_key=""YOURKEY"", oauth_nonce=""YOURCODE"", oauth_signature=""YOURSIGNATURE"", oauth_signature_method=""HMAC-SHA1″", oauth_timestamp=""TIMESTAMP"", oauth_token=""YOURTOKEN"", oauth_version=""1.0"""]]
)
in
Source

in powerBI desktop.

 

Can u send me screen shot where  i should navigate and add the above query in PBI desktop.

 

I can able to fecth from mysql or any other datasource using getdata button and then i will select the db i need.

 

But this type, i never did. Can u please help me where can i add the above query.

 

Thanks a lot @v-yuezhe-msft in advance

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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