Error while sending direct message


#1

$url = “https://api.twitter.com/1.1/direct_messages/new.json” ;
$text=“hellotwor”;
$screen_name=“Laks…”;
$res=$tweet->post($url, array(‘text’ => “$text”,‘screen_name’ => “$screen_name”));

ERROR–
stdClass Object ( [errors] => Array ( [0] => stdClass Object ( [message] => Sorry, that page does not exist [code] => 34 ) ) )

I am not getting what is the mistake.


#2

Hi,

This error code is related to a 404 status code returned by the request. Can you confirm if the URL is correct (from what you sent is OK, but your code may differ).

Also, please check if screen_name is equal to the user Twitter handle, not display name.


#3

Thank You very much Luis.
Problem was with “screen_name”.
I used specific handle @*.
Now its working fine.

Thank you Very much.