Skip to main content

Fetching workspace list

API resources

This article refers to the following API resources:

  • Method: GET
  • Endpoint: /workspaces
  • Description: Fetches the list of workspaces your token has access to.
  • Authentication: Bearer token

Overview

This article will guide you through the GET /workspaces endpoint's usage.

We will then break down the response body received from the API to see what useful information we can find.

Sending the request

Using Postman

Send this GET /workspaces request from Postman using our Public Collection. (💡 Learn more)

Using cURL

Or send it using cURL:

curl -L -X GET 'https://yourapi.datagalaxy.com/v2/workspaces' -H 'Authorization: Bearer {token}'
tip

Replace https://yourapi.datagalaxy.com/v2 with your API base URL to send your requests to your dedicated API instance (cf: Before you start)

Response payload

The API will respond with a payload similar to the one below.

At the response's root, you will find a project property containing a JSON object list.
Each JSON object refers to a workspace your token has access to.

Response payload
{
"organizations": [],
"projects": [
{
"description": "My workspace description",
"defaultOwnerUser": {
"firstname": "John",
"lastname": "Smith",
"fullname": "John Smith",
"email": "john.smith@datagalaxy.com",
"userId": "e62bdc00-2330-497c-9a1d-dd161d8e91fa"
},
"defaultStewardUser": {
"firstname": "John",
"lastname": "Smith",
"fullname": "John Smith",
"email": "john.smith@datagalaxy.com",
"userId": "e62bdc00-2330-497c-9a1d-dd161d8e91fa"
},
"id": "2d39b64c-6279-4635-a2de-b6dabf15af46:2d39b64c-6279-4635-a2de-b6dabf15af46",
"name": "MyWorkspace",
"defaultVersionName": "1",
"isVersioningEnabled": true,
"defaultVersionId": "06cc8379-1401-4dac-9abf-f93636bea9f1",
"trigram": "Myw",
"imageHash": "pmJ3mJT9pKIV5xtHQX/+bcsj+RKt1Fwxuj1GEscpe0A=",
"iconHash": "II0NYI2RNUoC6zLzbjA7YPM04T6rqlghyockBS8S7Zk="
}
]
}

workspaceId

Each workspace has an id. This id, also called workspaceId, will be used in other endpoints to point to the workspace.

Response payload
{
"organizations": [],
"projects": [
{
"description": "My workspace description",
"defaultOwnerUser": { ... },
...
"id": "2d39b64c-6279-4635-a2de-b6dabf15af46:2d39b64c-6279-4635-a2de-b6dabf15af46",
"name": "MyWorkspace",
"defaultVersionName": "1",
"isVersioningEnabled": true,
"defaultVersionId": "06cc8379-1401-4dac-9abf-f93636bea9f1",
...
}
]
}

versionId

Either you have versioning enabled or not, a workspace always has a defaultVersionId, also called versionId.
This versionId will be used in most of the API endpoints. It is required to execute your request in the right version of your workspace.

The versionId will be required in the next article, where we will make a request to create multiple objects.

Response payload
{
"organizations": [],
"projects": [
{
"description": "My workspace description",
"defaultOwnerUser": { ... },
...
"id": "2d39b64c-6279-4635-a2de-b6dabf15af46:2d39b64c-6279-4635-a2de-b6dabf15af46",
"name": "MyWorkspace",
"defaultVersionName": "1",
"isVersioningEnabled": true,
"defaultVersionId": "06cc8379-1401-4dac-9abf-f93636bea9f1",
...
}
]
}