Skip to content

Users

B2SHARE User API:s#

The B2SHARE API reveals information from users, who have set their profile to public, are active and have confirmed their email address.

Search users#

Serach for public users

  HTTP method: GET

  URL path: /api/users

  Required parameters: None

  Optional parameters: q, sort, size, page

  Status code on success: 200

  Returns: A list of public users matching the query in JSON format.

Command:

curl "https://$B2SHARE_HOST/api/users"
Returns:
{
  "hits": {
    "hits": [
      {
        "id": "1",
        "created": "2025-01-01T09:00:00.000000+00:00",
        "updated": "2025-01-01T09:00:00.000000+00:00",
        "links": {
          "self": "https://b2share.eudat.eu/api/users/1",
          "avatar": "https://b2share.eudat.eu/api/users/1/avatar.svg",
          "records_html": "https://b2share.eudat.eu/search/records?q=parent.access.owned_by.user:1"
        },
        "revision_id": 2,
        "active": true,
        "confirmed": true,
        "is_current_user": false,
        "email": "example@example.com",
        "username": "jdoe",
        "profile": {
          "full_name": "John Doe",
          "affiliations": "Affiliation"
        },
        "preferences": {
          "visibility": "public",
          "email_visibility": "public"
        }
      },
      ...
    ],
    "total": 16
  },
  "sortBy": "newest",
  "links": {
    "self": "https://b2share.eudat.eu/api/users?page=1&size=10&sort=newest",
    "next": "https://b2share.eudat.eu/api/users?page=2&size=10&sort=newest"
  }
}

Get a user#

Get a specific user.

  HTTP method: GET

  URL path: /api/users/<user-id>

  Required parameters: user-id

  Status code on success: 200

  Returns: The user in JSON format.

Command:

curl "https://$B2SHARE_HOST/api/users/1"
Returns:
{
    "id": "1",
    "created": "2025-01-01T09:00:00.000000+00:00",
    "updated": "2025-01-01T09:00:00.000000+00:00",
    "links": {
        "self": "https://b2share.eudat.eu/api/users/1",
        "avatar": "https://b2share.eudat.eu/api/users/1/avatar.svg",
        "records_html": "https://b2share.eudat.eu/search/records?q=parent.access.owned_by.user:1"
    },
    "revision_id": 2,
    "active": true,
    "confirmed": true,
    "is_current_user": false,
    "email": "example@example.com",
    "username": "jdoe",
    "profile": {
        "full_name": "John Doe",
        "affiliations": "Affiliation"
    },
    "preferences": {
        "visibility": "public",
        "email_visibility": "public"
    }
}

Last update : 18.11.2025

Last review : 18.11.2025