We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to hit the engagement endpoint but it always return status code :400 ,does anyone understand why ? function getEngagement($token,$tokenSecret){ $settings = array( 'oauth_access_token' => $token, 'oauth_access_token_secret' => $tokenSecret, 'consumer_key' => env('TWITTER_CONSUMER_KEY'), 'consumer_secret' => env('TWITTER_CONSUMER_SECRET') );
//$url = 'https://data-api.twitter.com/insights/engagement/totals'; $url = 'https://data-api.twitter.com/insights/engagement/28hr'; $requestMethod = 'POST'; $postfields = array( 'tweet_ids'=>array('1217776265337475073', '1217183078503845893'), 'engagement_types'=> array( 'impressions', ' engagements', ' url_clicks', 'detail_expands' ), 'groupings'=> array( 'grouping name'=> array( 'group_by'=>array( "tweet.id", "engagement.type", "engagement.hour" ))) ); $engagement = new TwitterAPIExchange($settings); $engagement->buildOauth($url, $requestMethod)->performRequest(true, [ CURLOPT_HTTPHEADER => array('Content-Type:application/json','Accept-Encoding:gzip'), CURLOPT_POSTFIELDS => json_encode($postfields) ]); dd($engagement); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm trying to hit the engagement endpoint but it always return status code :400 ,does anyone understand why ?
function getEngagement($token,$tokenSecret){
$settings = array(
'oauth_access_token' => $token,
'oauth_access_token_secret' => $tokenSecret,
'consumer_key' => env('TWITTER_CONSUMER_KEY'),
'consumer_secret' => env('TWITTER_CONSUMER_SECRET')
);
The text was updated successfully, but these errors were encountered: