AI-generated Key Takeaways
-
You can retrieve a specific dataset using its ID with a
curlrequest that includes your project number and an authorization token. -
You can list all datasets associated with your project using a similar
curlrequest, targeting the/datasetsendpoint. -
Both requests require you to provide your project number and an authorization bearer token in the headers.
-
The responses provide dataset details including name, display name, usage, creation time, and update time.
Get a Dataset
Send a request to get a dataset.
curl \ -H 'X-Goog-User-Project: PROJECT_NUMBER' \ -H "Authorization: Bearer $TOKEN" \ https://mapsplatformdatasets.googleapis.com/v1alpha/projects/PROJECT_NUMBER/datasets/DATASET_ID
Sample Request
curl \ -H 'X-Goog-User-Project: PROJECT_NUMBER' \ -H "Authorization: Bearer $TOKEN" \ https://mapsplatformdatasets.googleapis.com/v1alpha/projects/802317041956/datasets/f57074a0-a8b6-403e-9df1-e8a9e4f9fc46
Sample Response
{
"name": "projects/802317041956/datasets/f57074a0-a8b6-403e-9df1-e8a9e4f9fc46",
"displayName": "John Test Dataset",
"usage": [
"USAGE_DATA_DRIVEN_STYLING"
],
"createTime": "2022-08-15T17:50:00.189682Z",
"updateTime": "2022-08-15T17:50:00.189682Z"
}
List Datasets
Send a request to list all the datasets in the project.
curl \ -H 'X-Goog-User-Project: PROJECT_NUMBER' \ -H "Authorization: Bearer $TOKEN" \ https://mapsplatformdatasets.googleapis.com/v1alpha/projects/PROJECT_NUMBER/datasets
Sample Request
curl \ -H 'X-Goog-User-Project: PROJECT_NUMBER' \ -H "Authorization: Bearer $TOKEN" \ https://mapsplatformdatasets.googleapis.com/v1alpha/projects/802317041956/datasets
Sample Response
{
"datasets": [
{
"name": "projects/802317041956/datasets/f57074a0-a8b6-403e-9df1-e8a9e4f9fc46",
"displayName": "John Test Dataset",
"usage": [
"USAGE_DATA_DRIVEN_STYLING"
],
"createTime": "2022-08-15T17:50:00.189682Z",
"updateTime": "2022-08-15T17:50:00.189682Z"
},
{
"name": "projects/802317041956/datasets/2c8ae479-9670-4f5e-81d4-89c6435ca959",
"displayName": "Jane Test Dataset",
"usage": [
"USAGE_DATA_DRIVEN_STYLING"
],
"createTime": "2022-09-33T11:43:00.297945Z",
"updateTime": "2022-09-33T11:43:00.297945Z"
}
]
}