API Reference > Part II: Authenticate using JWT > Manage data collections > Retrieve all data collections
  

Retrieve all data collections

Use a REST API to retrieve the details of all data collections in Data Marketplace.

Endpoint and method

The following table describes the connection properties for the API:
Property
Description
Endpoint
/api/v2/data-collections
Method
GET
For more information about how you can call an API, see Authenticate using JWT.

Request

The following table describes the parameters that you enter in the request query:
Parameter
Description
Additional Information
search
Optional. Enter the search term to find a data collection by name or description.
To retrieve details for all the data collections in Data Marketplace, enter an asterisk (*).
Default value is an asterisk (*).
Ensure that the search terms that you enter don't contain an asterisk (*).
offset
Optional. Specify the starting index for the paginated results.
Default value is 0.
limit
Optional. Specify the maximum number of results that are displayed on a page.
Default value is 20.
Maximum value is 200.
segments
Optional. Specify the type of details that you want the API request to return.
Enter one or more of the following values:
  • - all. Returns all the details about each data collection that is retrieved.
  • - category. Returns the details about the category that contains a data collection.
  • - customAttributes. Returns the details about the custom attributes that are configured for a data collection.
  • - deliveryTargets. Returns the details about the delivery targets that are associated with a data collection.
  • - stakeholdership. Returns the type of user and role that are assigned as stakeholder on a data collection.
  • - systemAttributes. Returns the details about a data collection's creation and modification, such as the date when a data collection was created, the latest date when it was modified, and so on.
  • - termsOfUse. Returns the details about the terms of use that are associated with a data collection.
  • - usageContexts. Returns the details about the usage types that are associated with a data collection.
By default, the parameter is assigned no value and the API response includes only the basic information about the data collection such as the name, description and so on.
sortby
Optional. Specify the parameters to sort the search results.
Enter one of the following values:
  • - id
  • - name
  • - status
  • - createdBy
  • - createdOn
  • - modifiedBy
  • - modifiedOn
Default value is modifiedOn.
sortOrder
Optional. Set the sorting order of the search results.
Enter one of the following values:
  • - To sort the search results by ascending order, enter asc.
  • - To sort the search results by descending order, enter desc.
Default value is desc.
Note: The API has no payload.

Example request

The following example shows how you can use an API to retrieve the details of all data collections:
https://{{CDMP_URL}}/api/v2/data-collections

Response

When you invoke the API using a REST client, the client displays a response for the parameter values that you have entered.
The following example shows the response of an API call to retrieve the details of all data collections:
{
"pageInfo": {
"offset": 40,
"limit": 20,
"totalCount": 120
},
"links": {
"self": {
"href": "/data-collections?offset=40&limit=20"
},
"first": {
"href": "/data-collections?offset=0&limit=20"
},
"next": {
"href": "/data-collections?offset=60&limit=20"
},
"previous": {
"href": "/data-collections?offset=20&limit=20"
},
"last": {
"href": "/data-collections?offset=100&limit=20"
}
},
"items": [
{
"id": "2593524d-82f7-4dfd-bc6b-17088c046f9d",
"externalId": "DCL-1",
"name": "Aggregated Sales Data",
"description": "All sales data from around the world aggregated and standardized.",
"status": "UNPUBLISHED",
"assetGroups": [
{
"id": "b93c4539-a93e-440d-a4b4-95d69b8911e6",
"name": "ASIA",
"isInherited": true
}
]
}
]
}
The following table describes the parameters of each data collection that is retrieved:
Parameter
Description
pageInfo > offset
Starting index of the paginated results.
pageInfo > limit
The maximum number of results that are displayed on a page.
pageInfo > totalCount
Number of data collections retrieved.
links > self > href
The API that was invoked to generate this response.
links > first > href
The API endpoint that you can use to retrieve the search results that are displayed on the first page.
links > next > href
The API endpoint that you can use to retrieve the search results from the page following the one you currently have open.
links > previous > href
The API endpoint that you can use to retrieve the search results from the page prior to the one you currently have open.
links > last > href
The API endpoint that you can use to retrieve the search results that are displayed on the last page.
externalId
Reference identifier of the data collection.
name
Name of the data collection.
description
Description of the data collection.
status
Status of the data collection. The status indicates whether the data collection is discoverable by Data Users when they search for it.
A data collection can have one of the following statuses:
  • - PUBLISHED. The data collection is discoverable to Data Users.
  • - UNPUBLISHED. The data collection isn't discoverable to Data Users.
assetGroups
Details of the asset group that is assigned to the category that contains the data collection.
assetGroups > id
System-generated identifier of the asset group.
assetGroups > name
Name of the asset group.
assetGroups > isInherited
Indicates whether the asset group is directly assigned to the category or if the asset group is inherited from the category hierarchy.
This parameter can have one of the following values:
  • - true. The asset group is inherited from the category hierarchy.
  • - false. The asset group is directly assigned to the category.