Skip to content

Users calls

Rashmi Yadav edited this page Oct 25, 2013 · 19 revisions

To call /users

RubyStackoverflow.users(options = {})

Example

response = RubyStackoverflow.users({inname: 'raysrashmi', sort: 'reputation'})
response.data.first.display_name => 'Display Name of User'

response.data is an array of users. If there is any error then you can access it response.error

To call /users/{ids}

response = RubyStackoverflow.users_by_ids([ids], options = {})

Example

response = RubyStackoverflow.users_by_ids(['1363236'])

response.data is an array of users To call /users/{ids}/answers(answers of users in {ids})

response = RubyStackoverflow.users_with_answers(array of ids, options)

response.data is array of users You can get answers for a user

response.data.first.answers

To call /users/{ids}/badges(badges of users in {ids}

response = RubyStackoverflow.users_with_badges(['1363236'],{order: 'asc'})

You can get badges for a user

response.data.first.badges => array of badges of user

To call /users/{ids}/comments(comments of users in {ids})

response = RubyStackoverflow.users_with_comments(['1363236'],{sort: 'votes'})

You can get comments for a user response.data.first.comments reposne.data.first.comments.first.score

To call /users/{ids}/comments/{toid}(comments that the users in {ids} have posted in reply to the single user identified in {toid})

response = RubyStackoverflow.users_with_mentioned_questions(['707894','1004415'])

To call /users/{ids}/answers(answers of users in {ids}) To call /users/{ids}/answers(answers of users in {ids}) To call /users/{ids}/answers(answers of users in {ids}) To call /users/{ids}/answers(answers of users in {ids}) To call /users/{ids}/answers(answers of users in {ids})

Clone this wiki locally