Module: Yammer::Api::User

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

Instance Method Summary collapse

Instance Method Details

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

Examples:

Fetch users from the authenticated user's network

Yammer.all_users

Parameters:

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

    A customizable set of opts.

Options Hash (opts):

  • :page (Integer)

Returns:

Raises:

See Also:

Rate Limited?:

  • Yes

Authentication:

  • Requires user context



141
142
143
# File 'lib/yammer/api/user.rb', line 141

def all_users(opts={})
  get("/api/v1/users", opts)
end

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

Examples:

create a user with the email [email protected]

Yammer.create_user('[email protected]')

Parameters:

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

    A customizable set of options.

Options Hash (opts):

  • :email (String)
  • :full_name (String)
  • :guid (String)
  • :job_title (String)
  • :location (String)
  • :im_provider (String)
  • :im_username (String)
  • :work_telephone (String)
  • :work_extension (String)
  • :mobile_telephone (String)
  • :external_profiles (String)
  • :significant_other (String)
  • :kids_names (String)
  • :interests (String)
  • :summary (String)
  • :expertise (String)
  • :schools_csv (String)
  • :previous_companies_csv (String)
  • :preferred_my_feed (String)
  • :sticky_my_feed (String)
  • :prescribed_my_feed (String)

Returns:

Raises:

See Also:

Rate Limited?:

  • Yes

Authentication:

  • Requires user context



48
49
50
# File 'lib/yammer/api/user.rb', line 48

def create_user(opts={})
  post("/api/v1/users", opts)
end

#current_userYammer::ApiResponse

Examples:

Fetch data for the authenticated user

Yammer.current_user

Returns:

Raises:

See Also:

Rate Limited?:

  • Yes

Authentication:

  • Requires user context



128
129
130
# File 'lib/yammer/api/user.rb', line 128

def current_user
  get("/api/v1/users/current")
end

#delete_user(id) ⇒ Yammer::ApiResponse

Examples:

Delete user with ID 2

Yammer.delete_user(2)

Parameters:

  • id (Integer, String)

    A Yammer user ID

Returns:

Raises:

See Also:

Rate Limited?:

  • Yes

Authentication:

  • Requires user context



93
94
95
# File 'lib/yammer/api/user.rb', line 93

def delete_user(id)
  delete("/api/v1/users/#{id}")
end

#get_user(id) ⇒ Yammer::ApiResponse

Examples:

Fetch data user with ID 2

Yammer.get_user(2)

Parameters:

  • id (Integer, String)

    A Yammer user ID

Returns:

Raises:

See Also:

Rate Limited?:

  • Yes

Authentication:

  • Requires user context



105
106
107
# File 'lib/yammer/api/user.rb', line 105

def get_user(id)
  get("/api/v1/users/#{id}")
end

#get_user_by_email(email) ⇒ Yammer::ApiResponse

Examples:

Fetch data user with email [email protected]

Yammer.get_user_by_email('[email protected]')

Parameters:

  • email (Integer, String)

    A Yammer user ID

Returns:

Raises:

See Also:

Rate Limited?:

  • Yes

Authentication:

  • Requires user context



117
118
119
# File 'lib/yammer/api/user.rb', line 117

def get_user_by_email(email)
  get("/api/v1/users/by_email", :email => email)
end

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

Examples:

update info for a user with the email [email protected]

Yammer.update_user(1, :job_title => 'software engineer')

Parameters:

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

    A customizable set of options.

Options Hash (opts):

  • :email (String)
  • :full_name (String)
  • :guid (String)
  • :job_title (String)
  • :location (String)
  • :im_provider (String)
  • :im_username (String)
  • :work_telephone (String)
  • :work_extension (String)
  • :mobile_telephone (String)
  • :external_profiles (String)
  • :significant_other (String)
  • :kids_names (String)
  • :interests (String)
  • :summary (String)
  • :expertise (String)
  • :schools_csv (String)
  • :previous_companies_csv (String)
  • :preferred_my_feed (String)
  • :sticky_my_feed (String)
  • :prescribed_my_feed (String)

Returns:

Raises:

See Also:

Rate Limited?:

  • Yes

Authentication:

  • Requires user context



81
82
83
# File 'lib/yammer/api/user.rb', line 81

def update_user(id, opts={})
  put("/api/v1/users/#{id}", opts)
end

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

Examples:

Fetch users from the authenticated user's network followed by the user whose ID is provided

Yammer.users_followed(1)

Parameters:

  • id (Integer)

    the ID of the user for whom you want to get the users being followed

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

    A customizable set of opts.

Options Hash (opts):

  • :page (Integer)

Returns:

Raises:

Rate Limited?:

  • Yes

Authentication:

  • Requires user context



167
168
169
# File 'lib/yammer/api/user.rb', line 167

def users_followed_by(id, opts={})
  get("/api/v1/users/followed_by/#{id}", opts)
end

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

Examples:

Fetch users from the authenticated user's network following user whose ID is provided

Yammer.users_following(1)

Parameters:

  • id (Integer)

    the ID of the user whose followers you want to get

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

    A customizable set of opts.

Options Hash (opts):

  • :page (Integer)

Returns:

Raises:

Rate Limited?:

  • Yes

Authentication:

  • Requires user context



154
155
156
# File 'lib/yammer/api/user.rb', line 154

def users_following(id, opts={})
  get("/api/v1/users/following/#{id}", opts)
end

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

Examples:

Fetch users in a group that the authenticated user is in

Yammer.users_in_group(1)

Parameters:

  • id (Integer)

    the ID of the group for which you want to get the members of

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

    A customizable set of opts.

Options Hash (opts):

  • :page (Integer)

Returns:

Raises:

Rate Limited?:

  • Yes

Authentication:

  • Requires user context



180
181
182
# File 'lib/yammer/api/user.rb', line 180

def users_in_group(id, opts={})
  get("/api/v1/users/in_group/#{id}", opts)
end