List division members

This call returns a list of all all members of a division. In addition, you can list members with a specific role, e.g. all administrators within a division.

Request

https://api.sbgenomics.com/v2/users
https://gcp-api.sbgenomics.com/v2/users

Example request

GET /v2/users?division=my-division HTTP/1.1
Host: api.sbgenomics.com
Content-Type: application/json
X-SBG-Auth-Token: 8a6b42ec064246c9b52ddd68e907197a
curl -X GET \
  'https://api.sbgenomics.com/v2/users?division=my-division' \
   -H 'Content-Type: application/json' \
   -H 'Host: api.sbgenomics.com' \
   -H 'X-SBG-Auth-Token: 4da7743c069e427eba2b9ec270ecc056' \
from sevenbridges import Api

api = Api(url='https://api.sbgenomics.com/v2',
          token='3259c50e1ac5426ea8f1273259740f74')

# send GET request to SB API
users = api.users.query(division='my-division')

for user in users:
    print(user.username)

Header Fields

Name

Description

X-SBG-Auth-Token
required

Your Seven Bridges Platform authentication token.

Content-Type
required

application/json

###Query parameters

Name

Description

division slug
required

The slug of the division you are querying.

role

Specify the role to only list the division members with a certain role. The following roles are available:

  • administrator
  • member
  • external_collaborator

offset

The zero-based starting index in the entire collection of the first item to return. The default value is 0. This is a pagination-specific attribute.

limit

The maximum number of collection items to return for a single request. Minimum value is 1. The maximum value is 100 and the default value is 50. This is a pagination-specific attribute.

Response

See a list of Seven Bridges Platform-specific response codes that may be contained in the body of the response.

Example response body

{
    "href": "https://api.sbgenomics.com/v2/users?division=my-division&offset=0&limit=5",
    "items": [
        {
            "href": "https://api.sbgenomics.com/v2/users/my-division/rfranklin",
            "username": "my-division/rfranklin",
            "email": "[email protected]",
            "first_name": "Rosalind",
            "last_name": "Franklin",
            "role": "ADMIN",
            "affiliation": "SBG",
            "phone": "",
            "address": "",
            "city": "",
            "state": "",
            "country": "USA",
            "zip_code": ""
        },
        {
            "href": "https://api.sbgenomics.com/v2/users/my-division/jsmith",
            "username": "my-division/jsmith",
            "email": "[email protected]",
            "first_name": "John",
            "last_name": "Smith",
            "role": "MEMBER",
            "affiliation": "SBG",
            "phone": "",
            "address": "",
            "city": "",
            "state": "",
            "country": "USA",
            "zip_code": ""
         
        }
    ],
    "links": []
}