3

Is there a way to create a private group using the "yammer API"?

Gamesha
  • 39
  • 1
  • 4

4 Answers4

6

You can use below code

yam.platform.request({
                    // yam.request({
                    url: "groups.json?name=Group_Name&private=true",
                    method: "POST",
                    data: {},
                    success: function (group) {
                        console.dir(group);
                        getMyGroups();
                    },

                    error: function (group) {
                        console.error("There was an error with the request.");
                    }
                });
Mahesh
  • 730
  • 7
  • 26
1

No. You can only join/leave an existing group for the current user. See https://developer.yammer.com/restapi/#rest-groups

Peter Walke
  • 2,497
  • 6
  • 33
  • 50
1

You can create a new group in Yammer using REST API.

Endpoint:

POST https://www.yammer.com/api/v1/groups.json

Parameters:
name - [string], group name
description - [string], group description
private - [true/false], indicates whether group is private

So you can send this request to Yammer API to create a new private group.

POST https://www.yammer.com/api/v1/groups.json?name=new_group_name&private=true
user3433274
  • 79
  • 1
  • 2
  • This doesn't work, you get the following response from Yammer:{ "response": { "stat": "fail", "code": 17, "message": "Attempt to access a protected resource failed." } } – Peter Walke Sep 30 '14 at 14:20
  • 2
    I've just tested it in Fiddler and it works fine. The problem may be in auth token: http://stackoverflow.com/questions/22599921/yammer-rest-api-how-to-get-access-tokens-for-external-networks – user3433274 Sep 30 '14 at 15:00
  • 1
    This isn't a supported API at this time. – Brian Lyttle Jul 16 '15 at 15:50
  • @BrianLyttle What's the status of this API ? Can we use it although it not documented/supported ? It seems to work eversince. – Atyz Jul 04 '16 at 14:16
  • @BrianLyttle did anything change with regards to this not being "a supported API" over a year ago? – joweiser Oct 21 '16 at 08:17
-1

Actually, it looks like you can via an undocumented api.
See this code: https://github.com/OfficeDev/PnP/tree/master/Scenarios/Provisioning.Yammer

See this specific line:

// Get Yammer Group - Creates if does not exist YammerGroup group = YammerUtility.CreateYammerGroup(yammerGroupName, true, ConfigurationManager.AppSettings["YammerAccessToken"]);

Peter Walke
  • 2,497
  • 6
  • 33
  • 50