# DataFormat.Error in Power Query



## JanakiRam (Feb 22, 2016)

Hi All, 
I am getting below error in Power Query while pulling data from web.

*DataFormat.Error: Specified value has invalid CRLF characters.
**Parameter name: value*
*Details:*
*    OAuth oauth_consumer_key="@@@",oauth_nonce="@@@", *
*oauth_signature="@@@", oauth_signature_method="HMAC-SHA1?
*Note : if i removed quotes for the above parameters from the blow code i am getting Invalid Identifier error : (

*let

    Source = Web.Page(Web.Contents("https://api.twitter.com/1.1/search/tweets.json?q=spotfire"),[Headers=[#"Authorization"="OAuth oauth_consumer_key=""@@@"", 
oauth_signature=""@@@"", oauth_signature_method=""HMAC-SHA1?", oauth_timestamp="@@@", 
oauth_token="@@@", oauth_version="""1.0?"""]])
in
    Source*


----------



## ImkeF (Feb 22, 2016)

Are you passing parameters to where the placeholders @@@ stand now?

Then clean them before passing on, using Text.Clean:
= Table.TransformColumns(#"Previous Step",{{"Parameter", Text.Clean}})

This will remove unprintable characters like carriage returns and line feeds.


----------



## JanakiRam (Feb 22, 2016)

ImkeF said:


> Are you passing parameters to where the placeholders @@@ stand now?
> 
> Then clean them before passing on, using Text.Clean:
> = Table.TransformColumns(#"Previous Step",{{"Parameter", Text.Clean}})
> ...



Hi,

I have removed my tokens and key at placeholders for the confidentiality and put @@@.
But still getting same error


----------



## ImkeF (Feb 22, 2016)

Hm - just had a look at your code and it seems that the closing parenthesis after spotfire shouldn't be there:

 spotfire"*)*,[Headers=[#"

try  spotfire",[Headers=[#" instead and move the paranthesis to the end instead.


----------



## JanakiRam (Feb 22, 2016)

Oh My Bad... Please see the updated code, But still giving getting same error "*DataFormat.Error: Specified value has invalid CRLF characters."

= Web.Page(Web.Contents("https://api.twitter.com/1.1/search/tweets.json?q=spotfire",[Headers=[#"Authorization"="OAuth oauth_consumer_key=""@@@"",oauth_nonce=""389952772"", 
oauth_signature=""@@@"", oauth_signature_method=""HMAC-SHA1?", oauth_timestamp="1455867899", 
oauth_token="@@@", oauth_version="""1.0?"""]]))

please help on this, as not able to pull web data from the link past one week. I am not able to attach screen shot on this thread.

Thanks in advance.

*


----------



## JanakiRam (Feb 22, 2016)

HI imkef,

I will stay tune on this thread for your reply.


----------



## ImkeF (Feb 22, 2016)

a quote-sign too much in here:
oauth_version=""*"*1.0?"""]]))

should be oauth_version=""1.0?"""]]))

But apart from that I'm running out of ideas. 
I'd send a frown to the Microsoft-team then - they are really helpful.


----------



## ImkeF (Feb 22, 2016)

Do you copy/paste the @@@ parameter values or type them in manually?
If copy/paste: Then could it be that there are linefeeds in there?


----------



## JanakiRam (Feb 22, 2016)

I did copy-paste from API console as tokens and keys are very long alphanumeric text


----------



## JanakiRam (Feb 23, 2016)

Below is the updated code with no errors but returning only document with null table as elements.
let

source = Web.Page(Web.Contents("https://api.twitter.com/1.1/search/tweets.json?q=spotfire",[Headers=[#"Authorization"="OAuth", 
[FONT=inherit]#"oauth_consumer_key"="@@@",#"oauth_nonce"="1440311449", 
#"oauth_signature"="@@@", #"oauth_signature_method"="HMAC-SHA1?", 
#"oauth_timestamp"="1456200733", #"oauth_token"="@@@", #"oauth_version"="1.0"]]))

in 
source[/FONT]
Note: I am getting invalid error if i put double quote for oauth_timestamp and oauth_token and oauth_version is using two quotes getting error but if i use " ? "i am getting below error too.
DataSource.Error: The remote server return an HTTP status code '400' when trying to access 'https://api.twitter.com/1.1/search/tweets.json?q=spotfire'.
Details:
    DataSourceKind=Web
    DataSourcePath=https://api.twitter.com/1.1/search/tweets.json
    Url=https://api.twitter.com/1.1/search/tweets.json?q=spotfire


----------



## JanakiRam (Feb 22, 2016)

Hi All, 
I am getting below error in Power Query while pulling data from web.

*DataFormat.Error: Specified value has invalid CRLF characters.
**Parameter name: value*
*Details:*
*    OAuth oauth_consumer_key="@@@",oauth_nonce="@@@", *
*oauth_signature="@@@", oauth_signature_method="HMAC-SHA1?
*Note : if i removed quotes for the above parameters from the blow code i am getting Invalid Identifier error : (

*let

    Source = Web.Page(Web.Contents("https://api.twitter.com/1.1/search/tweets.json?q=spotfire"),[Headers=[#"Authorization"="OAuth oauth_consumer_key=""@@@"", 
oauth_signature=""@@@"", oauth_signature_method=""HMAC-SHA1?", oauth_timestamp="@@@", 
oauth_token="@@@", oauth_version="""1.0?"""]])
in
    Source*


----------



## ImkeF (Feb 23, 2016)

I understood from Curts comment in the other forum that this feature is not officially supported by Microsoft - so this might actually be the end of the journey.


----------

