oauth-io / oauth-phonegap

OAuth.io plugin for Apache Cordova/PhoneGap
195 stars 69 forks source link

/1.1/statuses/retweet/:id.json endpoint #68

Closed MsPseudolus closed 8 years ago

MsPseudolus commented 8 years ago

Hello! I am not having any success trying to access this Twitter endpoint using Oauth.io

1.1/statuses/retweet/:id.json

( https://dev.twitter.com/rest/reference/post/statuses/retweet/%3Aid )

Response is a 404

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) https://oauth.io/request/twitter/%2F1.1%2Fstatuses%2Fretweet%2F681526286041374700.json

I'm using the plugin in an Ionic app. Here's the code I'm using

$scope.reTweet = function(){
    rtUrl = '/1.1/statuses/retweet/' + $scope.tweet.id + ".json";

    OAuth.popup('twitter', {
        cache: true
      })
      .done(function(result) {
            result.post({
          url:  rtUrl
        })
      .fail(function (err) {
        //handle error with err
        console.log(err);
      });
    })
  };

Does the service just not handle endpoint url's that are formed like that? Or am I somehow going about it wrong?

The /1.1/statuses/update.json endpoint is working fine with a similar code structure. Do I just have to use that endpoint and embed the permalink for the retweeted tweet in the status text?

thanks!

MsPseudolus commented 8 years ago

Just discovered that I was accidentally passing the tweet ID as a number instead of a string. The number was then getting rounded and that left me with an invalid tweet ID.

Sorry for the spam!