Can't get direct messages? Read, Write and Access direct messages enabled.

bwebtemplates
@bwebtemplates Best Web Templates

We couldn't access twitter direct messages via our application, so we updated the application access to:
Read, Write and Access

but the oauth authorize app page still says:

This application will not be able to:

  • Access your direct messages.
  • See your Twitter password.

How long does it normally take for the Access to be reflected in the application? Any thoughts?

1 year 3 weeks ago

Replies

episod
@episod Taylor Singletary

Hi @bwebtemplates,

Are you using oauth/authenticate or oauth/authorize for the user-entering-their-credentials step of OAuth? oauth/authenticate will not negotiate new RWD-permitted tokens but oauth/authorize will.

1 year 3 weeks ago
ovrdrvsd
@ovrdrvsd Social Dashboard

I've got this problem as well. I'm using Abraham's PHP library. It don't understand what Taylor means by "oauth/authenticate or oauth/authorize". Am I able to control this myself?

1 year 3 weeks ago
beders
@beders Jochen Bedersdorfer

Never mind. Works as advertised.

1 year 3 weeks ago
ovrdrvsd
@ovrdrvsd Social Dashboard

how did you get it to work?

1 year 3 weeks ago
thebluzone
@thebluzone Blu zone

I am having this problem aswell, even though the app was for Read, Write and Direct Messages. I am not sure what happened, but how did everyone fix this?

1 year 2 weeks ago
rain_room
@rain_room Johannes G.

same problem here, also using Abraham's PHP library. I hope, @beders will share his solution.

1 year 1 week ago
beders
@beders Jochen Bedersdorfer

I don't have a special solution for you. Make sure you update your application permissions and have your users re-authorize the app.

1 year 1 week ago
rain_room
@rain_room Johannes G.

Thanks for the update, I found a different way to solve the problem:
In your redirect.php search the line
"$url = $connection->getAuthorizeURL($token);" (or so)
and change it into:
"$url = $connection->getAuthorizeURL($token,true);"
Now the user is forced to login and authorizes the application.
Have a look at the "getAuthorizeURL()" function!

1 year 1 week ago
armay1219
@armay1219 Alyeda May Magpuyo

What mean you found the good solution of you problem?

45 weeks 4 days ago
Cluster_M
@Cluster_M Cluster

getAuthorizeURL($token, FALSE);

Not "true".

35 weeks 6 days ago
aleemhab
@aleemhab aleem

I seem to still have this issue and can't seem to locate the issue. Any help please????? It is oauth/Authorize and I tried @rain_room solution, I'm using Abraham's PHP library and doesn't work.

47 weeks 5 days ago
BitzBlitzer
@BitzBlitzer Bitz Blitzer

@rain_room But we don't want the users to ALWAYS have to log-in, right? What's the best way to have them log in ONLY ONCE to upgrade to DM, and then never have to see that screen thereafter?

46 weeks 8 hours ago
BitzBlitzer
@BitzBlitzer Bitz Blitzer

All - let me attempt to clarify the problem / question. I'm not sure it's been stated.

Suppose that web application X wants their users to "Sign in with Twitter." They want to send their users to a single Twitter URL that:

(1) sends them right back to the website if they've already granted all permissions
(2) asks that they "upgrade" to DM if they previously only had R&W access
(3) asks them to grant R&W&DM if the user has never seen them before.

This is, I imagine, the most popular use-case scenario that any app could possibly face. What is the URL for this to work? Is it authorize, authenticate? Do we pass in force_login or not? Does this work with @abraham's PHP library?

46 weeks 7 hours ago
kurrik
@kurrik Arne Roomann-Kurrik

Unfortunately there isn't a single URL which will accomplish what you want. You can get something close to this flow if you follow these steps:

1.) Use /oauth/authenticate in order to let users "sign in" to the app, which will result in a read/write only token the first time the user signs in.
2.) Once signed in, prompt the user to see whether they wish to enable DMs.
3.) If yes, redirect the user to /oauth/authorize. Once this flow is done, store the new read/write/DM token, and note that the user has enabled DMs in the app data store.
4.) Future "Sign in with Twitter" calls through /oauth/authenticate will return a read/write/DM token.
5.) Check the "enabled DMs" flag in the data store to see whether to prompt the user to upgrade the token, and for any branching logic that requires DM access to be present.

45 weeks 6 days ago
BitzBlitzer
@BitzBlitzer Bitz Blitzer

Yeah, that's what I was afraid of. See, now I (as a developer) have to start keeping track of which users I've gotten DM access from, so that I can decide whether or not to prompt them.

Maybe there's a way I can ask Twitter who has DM access? SInce Twitter has to keep track anyway... but this is all kind of a mess, I wish developers just had a single URL they could configure to achieve the desired behavior. Makes me want to move back over to Facebook! ;-)

45 weeks 13 hours ago
kurrik
@kurrik Arne Roomann-Kurrik

Well if you're keeping track of the user's token you must have a persistence store. Hopefully adding a bit field into that store isn't too much of a difficulty. I'll agree that this isn't the most direct flow, but it really is more of an exception with the API, not the norm.

The way to determine whether a user has DM access would be to try and load their DM feed - an error response should indicate that the token does not support DMs: https://dev.twitter.com/docs/application-permission-model

45 weeks 13 hours ago
BitzBlitzer
@BitzBlitzer Bitz Blitzer

It's not that adding the bit is difficult ... it's the dual maintenance. What if my "belief" that the user has DM access somehow gets out of sync with Twitter's belief? In fact, this has happened already. Some of my users entered my service AFTER the change was made, so a number of them have DM and I don't know who.

I'll guess try the "DM feed load" hack. As for this being an exception vs. norm ... we're talking about authentication and authorization, this is the MOST important thing! If I'm having trouble getting users in the door, all the other bells and whistles don't really matter.

45 weeks 13 hours ago
MandeepMehrok
@MandeepMehrok Mandeep

I am also facing problem to get the Direct messages with Xauth approach. I have gone throgh developer kit and suuccessfully get the Direct messages with Oauth approach. But I don't want to include OAuth approach as it leads to drastic changes to my app(Desktop app).

45 weeks 6 days ago
episod
@episod Taylor Singletary

Direct message access is not available when acquiring access tokens through xAuth.

45 weeks 5 days ago
MandeepMehrok
@MandeepMehrok Mandeep

Thanks Taylor, yup i know this, but i have some areas in my app where i can't open a browser(an app using different data layer from the original app). Here i am not able to authenticate. I code i have provided the same verifier generated at app level to this app also but failed to authenticate.

45 weeks 5 days ago
MandeepMehrok
@MandeepMehrok Mandeep

Further i am having another problem with oAuth approach, i am not able to change the profile pic as it also fails to authenticate.

45 weeks 5 days ago
MandeepMehrok
@MandeepMehrok Mandeep

Does any one having solution for this or can share some code snippet.

Thanks!

44 weeks 4 days ago
episod
@episod Taylor Singletary

OAuth and xAuth are no different as far as uploading goes. xAuth is but one-step of OAuth.

Here is an example of uploading to the Twitter API correctly: https://github.com/themattharris/tmhOAuth/blob/master/examples/images.php

44 weeks 1 day ago
MandeepMehrok
@MandeepMehrok Mandeep

Thanks @episod for providing me an example, but its in PHP and I am totally blank with PHP.

I am developing the application in .NET(desktop application). Can you provide a link in .NET

44 weeks 1 day ago
payaljain32
@payaljain32 Payal

log out functionality of twitter app in android app.please help me.....its urgent

44 weeks 4 days ago
episod
@episod Taylor Singletary

There's no "log out" method in the Twitter API. The user controls the access your app has through the authorization screen and app management on twitter.com. What are you needing to "log out" exactly?

44 weeks 4 days ago
Sinister_svk
@Sinister_svk Sinister_svk

Hi all!
How long time does it usually takes to update settings from "Read and Write" to "Read, Write and Access direct messages"? I've tried to change and wait for about 5 or 6 hours, and all this time my application was inaccessible using neither oauth/authenticate nor oauth/authorize. So I had to rollback application type to "Read and Write" and authentication was fixed.

42 weeks 2 days ago
Antkittu
@Antkittu Antriksh Goswami

Hi Taylor,
We also updated the application access to:
Read, Write and Access
And Are using "oauth/authorize" for the user-entering-their-credentials step of OAuth
but when getting direct messages it says:
This application is not allowed to access or delete your direct messages

Any thoughts How to resolve with this issue.

35 weeks 6 days ago
ABISimmons2
@ABISimmons2 ABI Simmons

I can't get it to work

16 weeks 3 days ago
denismack
@denismack denis macks

SOLVED: getAuthorizeURL(oauth_token, 0)

5 weeks 6 days ago
vishalshah2012
@vishalshah2012 vishal shah

it worked perfectly.thanks

1 week 4 days ago