summaryrefslogtreecommitdiff
path: root/plugins/YammerImport/sn_yammerclient.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/YammerImport/sn_yammerclient.php')
-rw-r--r--plugins/YammerImport/sn_yammerclient.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/plugins/YammerImport/sn_yammerclient.php b/plugins/YammerImport/sn_yammerclient.php
index 0f244ced6..8f9f1d413 100644
--- a/plugins/YammerImport/sn_yammerclient.php
+++ b/plugins/YammerImport/sn_yammerclient.php
@@ -100,7 +100,7 @@ class SN_YammerClient
*
* @throws Exception for HTTP error or bad JSON return
*/
- protected function api($method, $params=array())
+ public function api($method, $params=array())
{
$body = $this->fetchApi("api/v1/$method.json", $params);
$data = json_decode($body, true);
@@ -217,4 +217,20 @@ class SN_YammerClient
{
return $this->api('users', $params);
}
+
+ /**
+ * High-level API hit: fetch all groups in the network (up to 20 at a time).
+ * Return data is the full JSON array returned, listing user items.
+ *
+ * The matching messages themselves will be in the 'users' item within.
+ *
+ * @param array $options optional set of additional params for the request.
+ * @return array of JSON-sourced user data arrays
+ *
+ * @throws Exception on low-level or HTTP error
+ */
+ public function groups($params=array())
+ {
+ return $this->api('groups', $params);
+ }
}