Closed ghost closed 10 years ago
Can you elaborate on what the issue is?
$settings = array(
'oauth_access_token' => "MY_OAUTH_ACCESS_TOKEN",
'oauth_access_token_secret' => "MY_OAUTH_ACCESS_TOKEN_SECRET",
'consumer_key' => "MY_CONSUMER_KEY",
'consumer_secret' => "MY_CONSUMER_SECRET"
);
$url = "https://api.twitter.com/1.1/statuses/update_with_media.json";
$postfields = array('status' => 'Some status',
'media' => array(@ . '/location'));
$requestMethod = 'POST';
$twitter = new TwitterAPIExchange($settings);
$response = $twitter->buildOauth($url, $requestMethod)
->setPostfields($postfields)
->performRequest();
var_dump(json_decode($response));
returns: {"errors":[{"code":189,"message":"Error creating status."}]}
I checked the headers, I haven't hit any limits.
The lib works just fine when I try to post a simple status.
I found out what the problem was:
$postfields = array('status' => 'Some status',
'media' => file_get_contents(@ . '/location'));
Can you provide a working example?