Note that there are some explanatory texts on larger screens.

plurals
  1. POColdFusion Post To Twitter Authentication Error
    primarykey
    data
    text
    <p>First off, my project requires me to make my own module so I can't use the various packages and products out there. Having said that, using the correct token, consumer_key, consumer_secret and token_secret variables, creating the correct Base Signature String and thus OAuth Signature from that string, I have had NO problem grabbing Twitter data via my ColdFusion module. If either of them were off, I wouldn't be able to even get Twitter data.</p> <p>So knowing that my variables are correct, I am still unable to POST a simple status tweet to my Twitter account via ColdFusion. Each time I try I get the same error: "Code:32, Message:'Could not authenticate you'". Since I know it can't be the variables, it has got to be how I'm sending the POST via ColdFusion, but I am unsure of what I am doing wrong. The following is the code I use to submit the POST:</p> <pre><code>&lt;cfhttp url="https://api.twitter.com/1.1/statuses/update.json" method="POST" throwonerror="yes" &gt; &lt;cfhttpparam type="header" name="Authorization" value='OAuth oauth_consumer_key="#oauthStruct.oauth_consumer_key#", oauth_nonce="#oauthStruct.oauth_nonce#", oauth_signature="#oauthStruct.oauth_signature#", oauth_signature_method="#oauthStruct.oauth_signature_method#", oauth_timestamp="#oauthStruct.oauth_timestamp#", oauth_token="#oauthStruct.oauth_token#", oauth_version="#oauthStruct.oauth_version#"'&gt; &lt;cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded"&gt; &lt;cfhttpparam type="formfield" name="status" value="#oauthStruct.status#"&gt; &lt;/cfhttp&gt; </code></pre> <p>Can somebody please look over the above code and help me figure out if I'm missing something or submitting incorrectly this call?</p> <p>Update: I changed the above code to this:</p> <pre><code> &lt;cfhttp url="https://api.twitter.com/1.1/statuses/update.json" method="POST" throwonerror="yes" &gt; &lt;cfhttpparam type="header" name="Authorization" value='OAuth oauth_consumer_key="#oauthStruct.oauth_consumer_key#", oauth_nonce="#oauthStruct.oauth_nonce#", oauth_signature="#oauthStruct.oauth_signature#", oauth_signature_method="#oauthStruct.oauth_signature_method#", oauth_timestamp="#oauthStruct.oauth_timestamp#", oauth_token="#oauthStruct.oauth_token#", oauth_version="#oauthStruct.oauth_version#"'&gt; &lt;cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded"&gt; &lt;cfhttpparam type="header" name="oauth_consumer_key" value="#oauthStruct.oauth_consumer_key#"&gt; &lt;cfhttpparam type="header" name="oauth_nonce" value="#oauthStruct.oauth_nonce#"&gt; &lt;cfhttpparam type="header" name="oauth_signature" value="#oauthStruct.oauth_signature#"&gt; &lt;cfhttpparam type="header" name="oauth_signature_method" value="#oauthStruct.oauth_signature_method#"&gt; &lt;cfhttpparam type="header" name="oauth_timestamp" value="#oauthStruct.oauth_timestamp#"&gt; &lt;cfhttpparam type="header" name="oauth_token" value="#oauthStruct.oauth_token#"&gt; &lt;cfhttpparam type="header" name="oauth_version" value="#oauthStruct.oauth_version#"&gt; &lt;cfhttpparam type="body" value="#signature_string#"&gt; &lt;/cfhttp&gt; </code></pre> <p>It still does not work, same authenticate error. Any other ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload