With all the correct files being included, can anybody tell me why the ID isn’t posting?
ini_set('display_errors', 1);
require_once('TwitterAPIExchange.php');
$settings = array(
'oauth_access_token' => $accesstoken,
'oauth_access_token_secret' => $accesstokensecret,
'consumer_key' => $consumerkey,
'consumer_secret' => $consumersecret
);
$url = 'https://api.twitter.com/1.1/direct_messages/destroy.json';
$postfields = array('id' => $id);
$requestMethod = 'POST';
$twitter = new TwitterAPIExchange($settings);
$response = $twitter->buildOauth($url, $requestMethod)
->setPostfields($postfields)
->performRequest();
var_dump(json_decode($response));
The error I receive is:
object(stdClass)#55 (1) { [“errors”]=> array(1) { [0]=> object(stdClass)#56 (2) { [“code”]=> int(38) [“message”]=> string(24) “ID parameter is missing.” } } }
Thanks,
Tom.