Create a Generic REST API base connection using the Flow Service API
A base connection represents the authenticated connection between a source and Adobe Experience Platform.
This tutorial walks you through the steps to create a base connection for Generic REST API using the Flow Service API.
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 Platform services.
- Sandboxes: Experience Platform provides virtual sandboxes which partition a single Platform instance into separate virtual environments to help develop and evolve digital experience applications.
For information on how to successfully make calls to Platform APIs, see the guide on getting started with Platform APIs.
Gather required credentials
In order for Flow Service to connect with Generic REST API, you must provide valid credentials for the authentication type of your choice. Generic REST API supports both OAuth 2 refresh code and basic authentication. See the following tables for information on the credentials for the two supported authentication types.
OAuth 2 refresh code
host
requestParameterOverride
.authorizationTestUrl
clientId
clientSecret
accessToken
requestParameterOverride
.refreshToken
expirationDate
accessTokenUrl
requestParameterOverride
connectionSpec.id
4e98f16f-87d6-4ef0-bdc6-7a2b0fe76e62
.Basic authentication
host
username
password
connectionSpec.id
4e98f16f-87d6-4ef0-bdc6-7a2b0fe76e62
.Create a base connection
A base connection retains information between your source and Platform, including your source’s authentication credentials, the current state of the connection, and your unique base connection ID. The base connection ID allows you to explore and navigate files from within your source and identify the specific items that you want to ingest, including information regarding their data types and formats.
Generic REST API supports both basic authentication and OAuth 2 refresh code. See the following examples for guidance on how to authenticate with either authentication types.
Create a Generic REST API base connection using OAuth 2 refresh code
To create a base connection ID using OAuth 2 refresh code, make a POST request to the /connections
endpoint while providing your OAuth 2 credentials.
API format
POST /connections
Request
The following request creates a base connection for Generic REST API:
curl -X POST \
'https://platform.adobe.io/data/foundation/flowservice/connections' \
-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}' \
-H 'Content-Type: application/json' \
-d '{
"name": "Generic REST API base connection with OAuth 2 refresh code",
"description": "Generic REST API base connection with OAuth 2 refresh code",
"connectionSpec": {
"id": "4e98f16f-87d6-4ef0-bdc6-7a2b0fe76e62",
"version": "1.0"
},
"auth": {
"specName": "oAuth2RefreshCode",
"params": {
"host": "{HOST}",
"accessToken": "{ACCESS_TOKEN}"
}
}
}'
name
description
connectionSpec.id
4e98f16f-87d6-4ef0-bdc6-7a2b0fe76e62
.auth.specName
auth.params.host
auth.params.accessToken
Response
A successful response returns the newly created connection, including its unique connection identifier (id
). This ID is required to explore your data in the next tutorial.
{
"id": "a5c6b647-e784-4b58-86b6-47e784ab580b",
"etag": "\"7b01056a-0000-0200-0000-5e8a4f5b0000\""
}
Create a Generic REST API base connection using basic authentication
To create a Generic REST API base connection using basic authentication, make a POST request to the /connections
endpoint of Flow Service API while providing your basic authentication credentials.
API format
POST /connections
Request
The following request creates a base connection for Generic REST API:
curl -X POST \
'https://platform.adobe.io/data/foundation/flowservice/connections' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'Content-Type: application/json' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
-d '{
"name": "Generic REST API base connection with basic authentication",
"description": "Generic REST API base connection with basic authentication",
"connectionSpec": {
"id": "4e98f16f-87d6-4ef0-bdc6-7a2b0fe76e62",
"version": "1.0"
},
"auth": {
"specName": "Basic Authentication",
"params": {
"host": "{HOST}",
"username": "{USERNAME}",
"password": "{PASSWORD}"
}
}
}'
name
description
connectionSpec.id
4e98f16f-87d6-4ef0-bdc6-7a2b0fe76e62
.auth.specName
auth.params.host
auth.params.username
auth.params.password
Response
A successful response returns the newly created base connection, including its unique connection identifier (id
). This ID is required to explore your source’s file structure and contents in the next step.
{
"id": "9601747c-6874-4c02-bb00-5732a8c43086",
"etag": "\"3702dabc-0000-0200-0000-615b5b5a0000\""
}
Next steps
By following this tutorial, you have created a Generic REST API base connection using the Flow Service API. You can use this base connection ID in the following tutorials: