Module: Yammer::Api::Group

Included in:
Client
Defined in:
lib/yammer/api/group.rb

Instance Method Summary collapse

Instance Method Details

#all_groups(opts = {}) ⇒ Yammer::ApiResponse

Examples:

Fetch all groups for authenticated user's network

Yammer.all_groups

Parameters:

  • opts (Hash) (defaults to: {})

    the opts to fetch a thread with

Options Hash (opts):

  • :page (Integer)
  • :sort_by (String)

    sort groups by created_on, creator, name default order is by number of messages

  • :letter (String)

    groups starting with letter

Returns:

Raises:

See Also:

Rate Limited?:

  • Yes

Authentication:

  • Requires user context



30
31
32
# File 'lib/yammer/api/group.rb', line 30

def all_groups(opts={})
  get("/api/v1/groups", opts)
end

#create_group(opts = {}) ⇒ Yammer::ApiResponse

Examples:

Create a new public group

Yammer.create_group(:name => "new group name", :private => "false")

Parameters:

  • opts (Hash) (defaults to: {})

    the opts to fetch a thread with

Options Hash (opts):

  • :name (String)
  • :description (String)
  • :private (Boolean)
  • :show_in_directory (Boolean)

Returns:

Raises:

See Also:

Rate Limited?:

  • Yes

Authentication:

  • Requires user context



58
59
60
# File 'lib/yammer/api/group.rb', line 58

def create_group(opts={})
  post("/api/v1/groups", opts)
end

#get_group(id) ⇒ Yammer::ApiResponse

Examples:

Fetch data for specified group

Yammer.get_group(74)

Parameters:

  • id (Integer)

    the group ID

Returns:

Raises:

See Also:

Rate Limited?:

  • Yes

Authentication:

  • Requires user context



42
43
44
# File 'lib/yammer/api/group.rb', line 42

def get_group(id)
  get("/api/v1/groups/#{id}")
end

#groups_for_user(id) ⇒ Yammer::ApiResponse

Examples:

Fetch groups for a given user

Yammer.groups_for_user(74)

Parameters:

  • id (Integer)

    the user ID

Returns:

Raises:

See Also:

Rate Limited?:

  • Yes

Authentication:

  • Requires user context



87
88
89
# File 'lib/yammer/api/group.rb', line 87

def groups_for_user(id)
  get("/api/v1/groups/for_user/#{id}")
end

#update_group(id, opts = {}) ⇒ Yammer::ApiResponse

Examples:

Update data for a given group

Yammer.update_group(74, :name => "new group name")

Parameters:

  • id (Integer)

    the group ID

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :name (String)
  • :description (String)
  • :private (Boolean)
  • :show_in_directory (Boolean)

Returns:

Raises:

See Also:

Rate Limited?:

  • Yes

Authentication:

  • Requires user context



75
76
77
# File 'lib/yammer/api/group.rb', line 75

def update_group(id, opts={})
  post("/api/v1/groups/#{id}", opts)
end