LISTING AVAILABLE DESTINATIONS
Use this endpoint to list all available destinations:
curl -X GET \
https://YOUR_STACK.datatap.adverity.com/api/target-types/ \
-H 'Authorization: Token TOKEN_VALUE' \
Result (cropped for one type of destination, Google Sheets):
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 456,
"name": "Google Sheets",
"slug": "google-sheets",
"url": "https://YOUR_STACK.datatap.adverity.com/api/target-types/456/",
"targets": "https://YOUR_STACK.datatap.adverity.com/api/target-types/456/targets/"
}
]
}
CREATE A NEW DESTINATION
To create a destination, first perform an OPTIONS call to list all available elements, then perform a POST request accordingly (see Example below).
Depending on the destination type, different elements will be required. It might make sense to initially look at all available options within the UI for the destination chosen.
EXAMPLE - CREATE A GOOGLE SHEETS DESTINATION
1. Use the GET request below to find out the ID of the Google Sheets destination.
curl -X GET \
https://YOUR_STACK.datatap.adverity.com/api/target-types/ \
-H 'Authorization: Token TOKEN_VALUE' \
2. Then, perform an OPTIONS call for the ID e.g. 456 to find out all relevant elements.
curl -X OPTIONS \
https://YOUR_STACK.datatap.adverity.com/api/target-types/456/targets/ \
-H 'Authorization: Token TOKEN_VALUE' \
3. Finally, make a POST request with at least the following elements in the body.
curl -X POST \
https://YOUR_STACK.datatap.adverity.com/api/target-types/456/targets/ \
-H 'Authorization: Token TOKEN_VALUE' \
-H 'Content-Type: application/json' \
-d '{
"name": "DESTINATION_NAME",
"auth": "CONNECTION_ID",
"stack": "WORKSPACE_ID"
}'
Optional parameters include:
- Output folder: OUTPUT_FOLDER
- Mode: MODE, either 1 (Truncate) or 2 (Append)
- Schema Mapping (
schema_mapping
) can be set to:- Boolean true or false for Google Sheets and Google BigQuery destinations.
- Three options for File and Azure Blob destinations:
- 0 - disabled
- 1 - enabled with metadata
- 2 - enabled without metadata
- Boolean true or false for Google Sheets and Google BigQuery destinations.
DELETING A DESTINATION
1. To delete an existing destination, first perform a GET request of all existing destinations of a certain type, e.g 456.
curl -X GET \
https://YOUR_STACK.datatap.adverity.com/api/target-types/456/targets/ \
-H 'Authorization: Token TOKEN_VALUE' \
2. Use the ID of the relevant destination e.g. 1 and perform a DELETE request.
curl -X DELETE \
https://YOUR_STACK.datatap.adverity.com/api/target-types/456/targets/1/ \
-H 'Authorization: Token TOKEN_VALUE' \
Comments
0 comments
Article is closed for comments.