Explore a database using the Flow Service API
This tutorial uses the Flow Service API to explore the contents and file structure of a third-party database.
Getting started
This guide requires a working understanding of the following components of Adobe Experience Platform:
- Sources: Experience Platform allows data to be ingested from various sources while providing you with the ability to structure, label, and enhance incoming data using Experience Platform services.
- Sandboxes: Experience Platform provides virtual sandboxes which partition a single Experience Platform instance into separate virtual environments to help develop and evolve digital experience applications.
The following sections provide additional information that you will need to know in order to successfully connect to a third-party database using the Flow Service API.
Using Experience Platform APIs
For information on how to successfully make calls to Experience Platform APIs, see the guide on getting started with Experience Platform APIs.
Explore your data tables
Using the connection ID for your database, you can explore your data tables by performing GET requests. Use the following call to find the path of the table you wish to inspect or ingest into Experience Platform.
API format
GET /connections/{BASE_CONNECTION_ID}/explore?objectType=root
{BASE_CONNECTION_ID}
Request
curl -X GET \
'https://platform.adobe.io/data/foundation/flowservice/connections/6990abad-977d-41b9-a85d-17ea8cf1c0e4/explore?objectType=root' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
Response
A successful response returns an array of tables from your database. Find the table you wish to bring into Experience Platform and take note of its path
property, as you are required to provide it in the next step to inspect its structure.
[
{
"type": "table",
"name": "test1.Mytable",
"path": "test1.Mytable",
"canPreview": true,
"canFetchSchema": true
},
{
"type": "table",
"name": "test1.austin_demo",
"path": "test1.austin_demo",
"canPreview": true,
"canFetchSchema": true
}
]
Inspect the structure of a table
To inspect the structure of a table from your database, perform a GET request while specifying the path of a table as a query parameter.
API format
GET /connections/{BASE_CONNECTION_ID}/explore?objectType=table&object={TABLE_PATH}
{BASE_CONNECTION_ID}
{TABLE_PATH}
Request
curl -X GET \
'https://platform.adobe.io/data/foundation/flowservice/connections/6990abad-977d-41b9-a85d-17ea8cf1c0e4/explore?objectType=table&object=test1.Mytable' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
Response
A successful response returns the structure of the specified table. Details regarding each of the table’s columns are located within elements of the columns
array.
{
"format": "flat",
"schema": {
"columns": [
{
"name": "TestID",
"type": "string",
"xdm": {
"type": "string"
}
},
{
"name": "Name",
"type": "string",
"xdm": {
"type": "string"
}
}
]
},
"data": [],
"cdcMetadata": {
"columnDetected": true
}
}
Next steps
By following this tutorial, you have explored your database, found the path of the table you wish to ingest into Experience Platform, and obtained information regarding its structure. You can use this information in the next tutorial to collect data from your database and bring it into Experience Platform.