Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DMs broken after September 17th (day that Twitters DM endpoints changed) #273

Closed
thomasesmith opened this issue Sep 28, 2018 · 1 comment

Comments

@thomasesmith
Copy link

The Twitter endpoint for sending a DMs was retired on September 17th, and replaced with a new one (direct_messages/events/new.json https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/api-reference/new-event), as did the post fields required to send one. Breaking the code in my project.

Can any one tell me the proper way now to use twitter-api-php to call this new DM create endpoint in order to send DMs? I just need a little help to patch my project.

As of now, using buildOauth->setPostfields->performRequest (like I was) suddenly results in a PHP warning "rawurlencode() expects parameter 1 to be string, array given"

I've also tried using buildOauth->performRequest, then setting the headers and post fields manually with CURLOPTs in the peformRequest params. This doesn't generate the warning but gets an authentication error back from the Twitter API (which is weird, because the other functions of this project still successfully use these same API keys/secrets just fine).

Thanks in advance.

@thomasesmith
Copy link
Author

thomasesmith commented Sep 28, 2018

Woops! Closing this because there was already closed issue regarding this.

I found the solution in the #268 discussion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant