The UsersService
allows you to retrieve details of user profiles, as well as to manage your own
user profile. User profiles include the user's username, given name, and user ID, as well as profile details such as
their hometown and profile image. In addition, you can also retrive a user's contacts, groups, picklists, and views.
For details on what is available, see the documentation on the User type.
Using the UsersService
you can also query for users that match given search criteria. Only data made
publicily available in their user profiles will be searchable.
Although most of the user profile details are public, such as username and display name, users do have some control
over what details are divulged. Users can opt to only make public their Socrata username, hiding their given name and
last name, so clients should rely on the displayName
for display purposes. In addition, some fields, such
as the user's email address, are only available when authenticated as that user.
In addition, all requests that modify user profile data require you to be authenticated as the user who's profile would be changed. For more details, see the documentation on the AuthenticationService.
Compliance Level: This method is a proprietary Socrata extension to the SODA standard
Query for all users. The resulting output will include summary information about the users within the page.
limit
integer (required)Total number of results to return. Can't exceed 200
page
integer (required)page number to offset the results by. Offset is (page-1) * limit
Query for users that match given search criteria:
> curl "https://explore.data.gov/api/users.json?name=Chris&pct;20Metcalf&max_results=5" > curl "https://explore.data.gov/api/users.json?tags=Socrata
Compliance Level: This method is a proprietary Socrata extension to the SODA standard
Retrieve a specific user by username or user ID.user ID
string (required)The username or user ID of the desired user
Retrieve a user's profile using their username or using their user ID:
> curl https://explore.data.gov/api/users/username.json > curl https://explore.data.gov/api/users/hyx2-6955.json
Retrieve a user's contacts, groups, picklists, and views:
> curl https://explore.data.gov/api/users/username/contacts.json > curl https://explore.data.gov/api/users/username/groups.json > curl https://explore.data.gov/api/users/username/picklists.json > curl https://explore.data.gov/api/users/username/views.json
Retrieve the profile image that has been set for a user:
> curl https://explore.data.gov/api/users/username/profile_images > profile_image.jpg
Compliance Level: This method is a proprietary Socrata extension to the SODA standard
Retrieve a list of the views that a user has created. If unauthenticated, only their public views will be returned. Authenticated users will also see views that have been shared to them, and will be able to see private views from their own account.user ID
string (required)The username or user ID whose views to retrieve
Retrieve a list of accessible views:
> curl --cookie cookies.txt https://explore.data.gov/api/users/username/views.json