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



16
17
18
# File 'lib/yammer/api/group.rb', line 16

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



44
45
46
# File 'lib/yammer/api/group.rb', line 44

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



28
29
30
# File 'lib/yammer/api/group.rb', line 28

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



73
74
75
# File 'lib/yammer/api/group.rb', line 73

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



61
62
63
# File 'lib/yammer/api/group.rb', line 61

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