Created
February 5, 2019 12:23
-
-
Save jcallaghan/1aeedfcda9fb52ced512198f2361d02c to your computer and use it in GitHub Desktop.
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
# Yammer app developer token | |
$token = "" | |
# Base Yammer API url | |
$yammerBaseUrl = "https://www.yammer.com/api/v1" | |
# Reference - Yammer Group | |
#$createGroupUri = "https://www.yammer.com/api/v1/groups.json?name=Example&private=True" | |
function Get-BaererToken() { | |
$headers = @{ Authorization=("Bearer " + $token) } | |
return $headers | |
} | |
# New group properties | |
$groupBody = @{ ` | |
name="New Yammer Group";` | |
private=$true;` | |
show_in_directory=$false;` | |
description="A description about the group." | |
} | |
# Post new group | |
$headers = Get-BaererToken | |
$groupsApi = "$($yammerBaseUrl)/groups" | |
Invoke-WebRequest –Uri $groupsApi –Method Post -Headers $headers -Body $groupBody |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment