2
votes

I want to to a simple GET users/show. I am coding in Javascrit and I was using this url in my Http get request with Api v.1 to get a users information : https://api.twitter.com/1/users/show.json?screen_name=BillGates&include_entities=true. But it gives me this error now :

{
errors: [
{
message: "The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.",
code: 68
}
]
}

So then I got the API v1.1 url which is this : https://api.twitter.com/1.1/users/show.json?screen_name=BillGates( Got it from https://dev.twitter.com/docs/api/1.1/get/users/show). This url gives me this error :

{
errors: [
{
message: "Bad Authentication data",
code: 215
}
]
}

I'm very new with Twitter API. And I need to replaced the API v1 with the API v1.1 If anyone knows what to do, that'd be really appreciated. Thanks

2
Version 1 has been retired..May be this can help...dev.twitter.com/docs/api/1.1/overviewSankalp Mishra
@Moni I have the same problem here, did you find a solution for this.Satheesh
You need to use oAuth. Has to be done serverside now.Seth

2 Answers

1
votes

I had this problem also in my C# application. It stopped working when V1 became deprecated and V1.1 became live. The APIBaseAddress was set as default to http://api.twitter.com/1/ when using the Twitterizer library.

I was using the following method to update my Twitter account -

StatusUpdateOptions so = new StatusUpdateOptions();

TwitterResponse<TwitterStatus> tweetResponse = TwitterStatus.Update(tokens, tweet, so);

Today this broke with the same exception as yours -

The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.

However I was able to resolve this by resetting the APIBaseAddress before the status update, like so -

so.APIBaseAddress = "http://api.twitter.com/1.1/";

I'm not sure how you would do this in javascript however once you are pointing at the right address it should work.

Perhaps something like the following -

GET https://api.twitter.com/1.1/users/show.json

or an ajax call -

$.ajax({
type: "GET",
url: "http://api.twitter.com/1.1/users/show.json",
datatype: "json"
});
0
votes

This current help page seems to suggest an XML response in v1.1 is still possible

https://dev.twitter.com/rest/reference/get/statuses/oembed

Is it incorrect ?