18

till now i was using twitter api v1,but my application suddenly stopped twitting,it shows me login failed every time i try to login,when i show response it gives me msg like

{"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}]}

this is written on twiter developer console

Deprecation of v1.0 of the API

Most developers won't need to do much work to transition from v1.0 to v1.1, but we want to make sure there is ample time to do so. We will be providing a 6 month window before turning off v1.0. After retirement (see the platform calendar for dates), the 1.0 endpoints will no longer be available.

i am using twitter4j-core-2.1.11.jar,*signpost-core-1.2.1.1.jar*, & signpost-commonshttp4-1.2.1.1.jar

so i tried to migrate my code from v1 to v1.1,i tried to find solution on twitter developer console regarding this,but could not get a proper way how to do it.

I hope Some one will help me to solve this issue

thanks

ISSUE RESOLVED: PEOPLE WHO ARE FACING TWITTER API MIGRATION ISSUE CAN DOWNLOAD UPDATED API WORKING TWITTER CODE FROM HERE

-change your consumer key and consumer secret key

Aamirkhan
  • 5,746
  • 10
  • 47
  • 74

3 Answers3

21

I was also facing the same problem as Twitter no more supports REST 1.0 from June 11'13. But I fixed the problem by replacing with the latest twitter4j jar file.If you are using twitter4j jar for your application to authenticate with twitter means it will definitely work for you.

1.Download the latest twitter4j from here

2.Replace it with the older one and you are done.

EDIT

Initially after replacing the twitter4j jar, it may show error in package importing. if so then replace

import twitter4j.http.AccessToken;

with

import twitter4j.auth.AccessToken;

Cheers

Tarun
  • 13,727
  • 8
  • 42
  • 57
Spring Breaker
  • 8,233
  • 3
  • 36
  • 60
  • Not working for me. It is giving errors in TwitterApp.java and AccessToken.java files. because the JAR doesn't contain those classes. – Ganesh Jun 17 '13 at 14:03
  • I think you are making mistake in importing the proper package.See my edited answer. – Spring Breaker Jun 18 '13 at 05:23
  • @user2012 You are the man..+1 for the import..Could you please post the same at http://stackoverflow.com/questions/16719134/invalid-header-cookie-when-integrate-twitter-in-android so that i can award you the bounty. – hemanth kumar Jun 19 '13 at 07:04
  • 1
    @user2012, I am uploading image to my twitter account, everything is fine now after following your answer but there are two errors which I couldn't resolved 1. import twitter4j.util.ImageUpload; 2. OAuthAuthorization auth = new OAuthAuthorization (conf, conf.getOAuthConsumerKey (), conf.getOAuthConsumerSecret (), new AccessToken (conf.getOAuthAccessToken (), conf.getOAuthAccessTokenSecret ())); ImageUpload upload = ImageUpload.getTwitpicUploader (twitpic_api_key, auth); how can I resolve this, please give me a solution – rahul Jun 20 '13 at 11:43
  • Hi Rahul, did you find out solution for your problem. – Lokesh Aug 31 '13 at 18:45
  • Thanks, your suggestion makes my day :) its working fin once changing the new twitter4j. – RAAAAM Dec 26 '13 at 11:57
3

This has been known for a long time.

You will need to rewrite your communication with the twitter API according to it's documentation which can be found here.

There aren't any specific answers to your question because you don't ask a specific migration question. So either specify what you would like to know, the only proper way to answer this question would be to write an entire twitter application which uses all api calls in v 1.1.

So read the documentation, adjust all your api calls. Make sure authorization is up to 1.1. and test. No tips and tricks, just plain ol' developing.

here are other resources that we’ve pulled together to help make this transition more smooth:

Timmetje
  • 7,641
  • 18
  • 36
2

This is worked for me :

You just have to add twitter4j-core-3.0.3.jar and twitpic4j.jar file into your libs folder with your Twitter 1.0 and it will work well.

Download jar file from here : http://code.google.com/p/comp3111-project-team201/downloads/detail?name=twitter4j-core-3.0.3.jar&can=2&q=

Pacane
  • 20,273
  • 18
  • 60
  • 97
Mitul Goti
  • 2,657
  • 1
  • 22
  • 19