User-related REST APIs

Users include any person who interacts with your AnswerHub site — from you, the site administrator or owner, down to those who only belong to the default users group. This section guides you in creating API requests that involve users.

Documentation Related to Users

📘

Note on userIds:

User Sorting Criteria and Data Model

User Sorting Criteria

We support the following sorting criteria in operations returning a paged list of users:

Criteria Name

Field

Order

Description

reputation

reputation

descending

This parameter sorts users from most reputable (highest amount of reputation points) to least reputable (least amount of reputation points).

username

username

ascending

This parameter sorts users by username in ascending alphabetical order (Aa, Bb, Cc, etc).

recent

creationDate

descending

This parameter sorts users from the most recent to the earliest created (registered).

oldest

creationDate

ascending

This parameter sorts users from the earliest to the most recently created (registered).

default

By default (if you do not select other sort options) the AnswerHub API will sort returned users in a request by reputation, from most to least.

User Data Model: Field Summary

Field Name

Type

Example(s)

Description

avatar

URL

http://www.gravatar.com/avatar/50

This is the URL connected to the avatar image for a user.

bronze

Integer

3

This is a count of a user's Bronze-level awards.

creationDate

Timestamp

1328817889000

This is the timestamp formatted creation date of a given user.

creationDateFormatted

String

40948.62778

This is the string formatted creation date of a given user.

gold

Integer

0

This is a count of a user's Gold-level awards.

id

Integer

23

This is the unique integer (digit) identifier for a given user.

moderator

Boolean

FALSE

This is the boolean flag that specifies whether a given user has been granted moderator permissions.

modificationDate

Timestamp

1328817889000

This is the timestamp formatted date when last updating or modifying a given user's information.

realname

String

James Bond

This is the human readable real name of a user. The value will only return if the Site Admin has chosen to show Real Names rather than User Names. If the Site Admin has chosen to show User Names, the value will be empty. (Accessed via Users & Groups > Settings > General.)

reputation

Integer

1

This is the integer (digit) representation of the number of reputation points a user has.

silver

Integer

1

This is a count of a user's Silver-level awards.

superuser

Boolean

TRUE

This is the boolean flag that specifies whether a given user has been granted administrator permissions.

type

String

(always/constant) "user"

This is the type discriminator.

username

String

james007

This is the assigned username for a given user.

slug

String

"james-bond"

This is a slug representation of a user's real name.