Forum Discussion

janakiram's avatar
janakiram
Regular Visitor
10 years ago
Solved

Bad Request in Power Query

Hi All,

I am very new to Power Query!!!

 

I am getting below error while connecting below url

Details: "Web.Contents failed to get contents from https://api.twitter.com/1.1/search/tweets.json?q=PowerPivot  (400): Bad Request".

Please suggest, same error is coming for any search key word.

 

Regards,

Ram

8 Replies

  •  

    Hi Janki,

     

    Please reffer to below link it has similar problem and it suggest to change the code a bit.

     

    http://www.powerpivotblog.com/getting-data-into-power-query-with-the-twitter-search-api-how-to-hack-pq-to-use-oauth/

     

    Existing Code

     

    let
    Source = Web.Contents(“https://api.twitter.com/1.1/search/tweets.json?q=PowerPivot”)
    in
    Source

     

    New Code

    let

    Source = Web.Contents(“https://api.twitter.com/1.1/search/tweets.json?q=PowerPivot&count=100″, [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

     

    Hope this will help.

     

    Regards

    Gurpreet Sethi

    • janakiram's avatar
      janakiram
      Regular Visitor

      Thanks Gurpreet, I will check on this.

       

      By

      Ram.

      • janakiram's avatar
        janakiram
        Regular Visitor

        I have tried as per the advise but i got one error as " Download Failed" at "Close & Load" Step". Please help what could be the error cause.

         

         

         

         

        By

        Ram

  • Anonymous's avatar
    Anonymous
    Not applicable

    Where do we get the auth details from? Trying to use the API in PBI desktop.

     

     

    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″””]]

  • Hi janakiram were you able to find a solution? As a workaround, maybe you can try to test your connection with a 3rd party connector. I've tried windsor.ai, supermetrics and funnel.io. I stayed with windsor because it is much cheaper so just to let you know other options. In case you wonder, to make the connection first search for the Salesforce connector in the data sources list:

     

     

    After that, just grant access to your Salesforce account using your credentials, then on preview and destination page you will see a preview of your Salesforce fields:

     

     

    There just select the fields you need. It is also compatible with custom fields and custom objects, so you'll be able to export them through windsor.  Finally, just select PBI as your data destination and finally just copy and paste the url on PBI --> Get Data --> Web --> Paste the url.