Im having a hard time getting Twitter to delete a status using the PHP OAuth library.
I am using this same method for posting (OAUTH_TYPE_FORM, and OAUTH_HTTP_METHOD_POST), and it works well.
Here is my code for the Delete reques:
$oauth = new OAuth($twitter['CONSUMER_KEY'], $twitter['CONSUMER_SECRET'], OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_FORM);
$oauth->setToken($access_token['oauth_token'], $access_token['oauth_token_secret']);
$oauth->fetch("http://api.twitter.com/1/statuses/destroy/".$delete_id, NULL, OAUTH_HTTP_METHOD_POST);
I keep receiving a 401 Error. Any help please advise 🙂
Make sure to include the format http://api.twitter.com/version/statuses/destroy/:id.format which can be
xmlorjson.$oauth->fetch("http://api.twitter.com/1/statuses/destroy/".$delete_id.".json", NULL, OAUTH_HTTP_METHOD_POST);Also,
$delete_idshould be stored as a string as it might be too large to be represented as an integer properly in PHP.ie)
$delete_id = 68090979596505088765 + "";instead of$delete_id = 68090979596505088765;