incorrect signature with get parameters

6 views
Skip to first unread message

galeyte

unread,
May 24, 2011, 8:25:27 AM5/24/11
to Twitter Development Talk
Hi again !

I'me still working on my javascript twitter client.
At this time, every request i make using POST method work perfectly,
but i'm experiencing some trouble using GET parameters with oauth.

Here is my code to retweet a message :

var parameters = ["oauth_consumer_key="+consumer_key,
"oauth_nonce="+nonce, "oauth_signature_method=HMAC-SHA1",
"oauth_token="+accessor.oauth_token, "oauth_timestamp="+time,
"oauth_version=1.0". "id=" + id];

var baseString = getBaseString(parameters, nonce, time, "GET", "htts://
api.twitter.com/1/statuses/"+id+".json");
var signature = b64_hmac_sha1(consumer_secret + "&" +
accessor.oauth_token_secret, baseString);

As i'm having the same problems with direct messages, i assume my
mistake is in the parameters part or the basestring generation.

This signature method perfectly works with POST (i'm currently using
it for timeline and mentions).

Thanks for helping me !

--
gaetan

galeyte

unread,
May 24, 2011, 10:57:19 AM5/24/11
to Twitter Development Talk
I've tried using POST and GET method.
And i've seen the "htts: mistake, but doesn't change anything. :(

Arnaud Meunier

unread,
May 24, 2011, 4:43:29 PM5/24/11
to twitter-deve...@googlegroups.com
Hey there,

The URL you're passing to your getBaseString function is not correct. The correct endpoint to ReTweet a tweet is "/1/statuses/retweet/:id" (cf http://dev.twitter.com/doc/post/statuses/retweet/:id). Also remove the "id" part in your parameters.

Arnaud / @rno



--
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: https://groups.google.com/forum/#!forum/twitter-development-talk

galeyte

unread,
May 25, 2011, 9:12:46 AM5/25/11
to Twitter Development Talk
Hi Arnaud,

Thanks for answering so quickly.
It stil does not work when using http but it does work perfectly when
using https !

Thx

On May 24, 10:43 pm, Arnaud Meunier <arn...@twitter.com> wrote:
> Hey there,
>
> The URL you're passing to your getBaseString function is not correct. The
> correct endpoint to ReTweet a tweet is "/1/statuses/retweet/:id" (cfhttp://dev.twitter.com/doc/post/statuses/retweet/:id). Also remove the "id"
> part in your parameters.
>
> Arnaud / @rno <http://twitter.com/rno>
Reply all
Reply to author
Forward
0 new messages