Could not authenticate you

api

#1

Hi. I get:

[code] => 32
[message] => Could not authenticate you.
when using -> https://dev.twitter.com/rest/reference/get/direct_messages/events/show
I use Abraham library from git.
This is my code.
$this->connection->get(“direct_messages/show?id=” . 852275615017426947);
I get list of all direct messages without problems. But here i got error.
Can someone help ?


#2

The format for using TwitterOAuth is get('path', ['param' => 'value']); So what you’ll want is this:

$this->connection->get("direct_messages/show", ["id" => 852275615017426947]);

Your snippet would create a URL like this which is not valid:

https://api.twitter.com/1.1/direct_messages/events/show?id=852275615017426947.json

#3

Thank you!