This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
use GuzzleHttp\Client; | |
const HOOTSUITE_CLIENT_ID = 'yourclientid'; // your client ID and secret are available through the developer dash | |
const HOOTSUITE_CLIENT_SECRET = 'yourclientsecret'; // if you don't have API access yet, email app.directory@hootsuite.com | |
$member_id = '123'; // the memberId of a user of your Hootsuite app, available through the dashboard SDK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
use GuzzleHttp\Client; | |
const HOOTSUITE_CLIENT_ID = 'yourclientid'; // your client ID and secret are available through the developer dash | |
const HOOTSUITE_CLIENT_SECRET = 'yourclientsecret'; // if you don't have API access yet, email app.directory@hootsuite.com | |
$member_id = '17107276'; // the memberId of a user of your Hootsuite app, available through the dashboard SDK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
use GuzzleHttp\Client; | |
const HOOTSUITE_ACCESS_TOKEN = 'your Hootsuite oauth token'; // obtained through OAuth | |
const FACEBOOK_PAGE_SOCIAL_PROFILE_ID = "121476024"; // obtain this through the socialProfiles API | |
$hsClient = new Client([ | |
'headers' => ['Authorization' => 'Bearer ' . HOOTSUITE_ACCESS_TOKEN] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
use GuzzleHttp\Client; | |
const OWLY_KEY = 'your Ow.ly API'; // contact dev.support@hootsuite.com if you need one! | |
const HOOTSUITE_ACCESS_TOKEN = 'your token'; // obtained through OAuth | |
$owlyClient = new Client([ | |
'base_uri' => 'http://ow.ly' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"info": { | |
"name": "Twitter OAuth", | |
"_postman_id": "b18dd2c3-294a-9b0b-4150-8662dfab3cd0", | |
"description": "", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
}, | |
"item": [ | |
{ | |
"name": "Get an oauth_token", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.codec.binary.Hex; | |
import org.apache.commons.codec.digest.DigestUtils; | |
// ... | |
public String computeHash(String uId, String ts, String secret) { | |
byte[] digest = DigestUtils.sha512(uId + ts + secret); | |
char[] hex = Hex.encodeHex(digest); | |
return new String(hex); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$token = 'your-token-here'; | |
$params = array( | |
'startTime' => date(DATE_ISO8601, time()-24*60*60*7), | |
'endTime' => date(DATE_ISO8601, time()) | |
); | |
$url = "https://apis.hootsuite.com/v1/messages?" . http_build_query($params); | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer ' . $token)); |