cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mehaboob557 Member
Member

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

Accepted Solutions
mehaboob557 Member
Member

Re: Need to get the data which has OAUTH1

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.

 

 

5 REPLIES 5
Moderator v-yuezhe-msft
Moderator

Re: Need to get the data which has OAUTH1

@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.
mehaboob557 Member
Member

Re: Need to get the data which has OAUTH1

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

mehaboob557 Member
Member

Re: Need to get the data which has OAUTH1

I am facing this error

 

ertyu.PNG

 

 

Please help me how can i over come this?

Moderator v-yuezhe-msft
Moderator

Re: Need to get the data which has OAUTH1

@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.
mehaboob557 Member
Member

Re: Need to get the data which has OAUTH1

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.