Create a Button (or use a URL) to send a direct message to a specified user


#1

Hello Community.

I’m a very young developer and created a ton of websites using WordPress. Therefore, my coding skills aren’t that great, but at least I know a little about what I am doing.

I’m the developer of a organisation and we’re doing some online gaming tournaments weekly. We contact teams than in a big frequency to tell them that they are successfully in the tournament. Of course this leads in a spam prevention and we’re unable to write them.
But if those people would simply send us a DM in before, this spam protection should not occur and we could work faster.

Therefore (and because I’ve not yet worked with the Twitter-API), I’m asking you guys if anyone could help me out or explain it a little bit, because the Developer Documentation isn’t that easy for a noobie.

Kind regards,
Niclas

EDIT:
Tried a little bit and came to this using a tutorial. Seems not to be working :confused: Anyone help?

<?php require_once('TwitterAPIExchange.php'); $settings = array( 'oauth_access_token' => "3049402203-XXXX...", 'oauth_access_token_secret' => "n0rr5pF4XXXX...", 'consumer_key' => "7pT01vfVXXXX...", 'consumer_secret' => "3RXuvaMZrIe9z2LICOXXXX..." ); $requestMethod = "POST"; $url = "https://api.twitter.com/1.1/direct_messages/new.json?text=test&screen_name=esportclubdesup"; $twitter = new TwitterAPIExchange($settings); $string = json_decode($twitter->setGetfield($getfield) ->buildOauth($url, $requestMethod) ->performRequest(),$assoc = TRUE); ?>

#2

I replied to a nearly identical question last week:


#3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.