curl --request POST \
--url https://app.agentcloud.dev/{resourceSlug}/forms/datasource/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: req.json' \
--data '{
"connectorId": "<string>",
"datasourceName": "<string>",
"datasourceDescription": "<string>",
"sourceConfig": "<unknown>"
}'import requests
url = "https://app.agentcloud.dev/{resourceSlug}/forms/datasource/test"
payload = "{\n \"connectorId\": \"<string>\",\n \"datasourceName\": \"<string>\",\n \"datasourceDescription\": \"<string>\",\n \"sourceConfig\": \"<unknown>\"\n}"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "req.json"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'req.json'},
body: '{\n "connectorId": "<string>",\n "datasourceName": "<string>",\n "datasourceDescription": "<string>",\n "sourceConfig": "<unknown>"\n}'
};
fetch('https://app.agentcloud.dev/{resourceSlug}/forms/datasource/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.agentcloud.dev/{resourceSlug}/forms/datasource/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\n \"connectorId\": \"<string>\",\n \"datasourceName\": \"<string>\",\n \"datasourceDescription\": \"<string>\",\n \"sourceConfig\": \"<unknown>\"\n}",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: req.json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.agentcloud.dev/{resourceSlug}/forms/datasource/test"
payload := strings.NewReader("{\n \"connectorId\": \"<string>\",\n \"datasourceName\": \"<string>\",\n \"datasourceDescription\": \"<string>\",\n \"sourceConfig\": \"<unknown>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "req.json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.agentcloud.dev/{resourceSlug}/forms/datasource/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "req.json")
.body("{\n \"connectorId\": \"<string>\",\n \"datasourceName\": \"<string>\",\n \"datasourceDescription\": \"<string>\",\n \"sourceConfig\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.agentcloud.dev/{resourceSlug}/forms/datasource/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'req.json'
request.body = "{\n \"connectorId\": \"<string>\",\n \"datasourceName\": \"<string>\",\n \"datasourceDescription\": \"<string>\",\n \"sourceConfig\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"code": 123,
"discoveredSchema": {},
"streamProperties": {},
"sourceId": "<string>"
}{
"message": "<string>",
"code": 123
}{
"message": "<string>",
"code": 123
}{
"message": "<string>",
"code": 123
}Test A Datasource To Be Added
Test a new datasource. This is required to gather the datasource schema, tables and values to continue to the next stage of addition. This MUST be executed first when adding a new datasource
curl --request POST \
--url https://app.agentcloud.dev/{resourceSlug}/forms/datasource/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: req.json' \
--data '{
"connectorId": "<string>",
"datasourceName": "<string>",
"datasourceDescription": "<string>",
"sourceConfig": "<unknown>"
}'import requests
url = "https://app.agentcloud.dev/{resourceSlug}/forms/datasource/test"
payload = "{\n \"connectorId\": \"<string>\",\n \"datasourceName\": \"<string>\",\n \"datasourceDescription\": \"<string>\",\n \"sourceConfig\": \"<unknown>\"\n}"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "req.json"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'req.json'},
body: '{\n "connectorId": "<string>",\n "datasourceName": "<string>",\n "datasourceDescription": "<string>",\n "sourceConfig": "<unknown>"\n}'
};
fetch('https://app.agentcloud.dev/{resourceSlug}/forms/datasource/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.agentcloud.dev/{resourceSlug}/forms/datasource/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\n \"connectorId\": \"<string>\",\n \"datasourceName\": \"<string>\",\n \"datasourceDescription\": \"<string>\",\n \"sourceConfig\": \"<unknown>\"\n}",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: req.json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.agentcloud.dev/{resourceSlug}/forms/datasource/test"
payload := strings.NewReader("{\n \"connectorId\": \"<string>\",\n \"datasourceName\": \"<string>\",\n \"datasourceDescription\": \"<string>\",\n \"sourceConfig\": \"<unknown>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "req.json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.agentcloud.dev/{resourceSlug}/forms/datasource/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "req.json")
.body("{\n \"connectorId\": \"<string>\",\n \"datasourceName\": \"<string>\",\n \"datasourceDescription\": \"<string>\",\n \"sourceConfig\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.agentcloud.dev/{resourceSlug}/forms/datasource/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'req.json'
request.body = "{\n \"connectorId\": \"<string>\",\n \"datasourceName\": \"<string>\",\n \"datasourceDescription\": \"<string>\",\n \"sourceConfig\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"code": 123,
"discoveredSchema": {},
"streamProperties": {},
"sourceId": "<string>"
}{
"message": "<string>",
"code": 123
}{
"message": "<string>",
"code": 123
}{
"message": "<string>",
"code": 123
}Authorizations
Path Parameters
Body
Task object to be added with at minimum all required fields, _id must be ommited, this will be generated by the api and returned upon successful completion.
The type of datasource being pulled from, the full list of supported sources and their corresponding in JSON format can be found at: 'https://connectors.airbyte.com/files/generated_reports/connector_registry_report.json'. One of these connectors must be selected as the type of datasource to pull from. Insert the Id of the connector in this field
sourceConfig is defined by Airbyte to determine the config required to set up the datasource with Airbyte. See the docs at: 'https://reference.airbyte.com/reference/createsource' for more information. See the 'configuration' body params and find the source that you are using.
Used to indicate howoften the datasource is synced, this syncing is to ensure the data within Agent Cloud is synchronised with the data within the datasource. This is the period between each synchronisation. The specific number of each period is set later in the addition process (i.e. when using addDatasourceApi).
minute, hour, day, week, month Response
Successfully tested the datasource and validated it's configuration for Airbyte, can now move onto the addDatasourceApi route
Server response
This return is mainly used for front end operations of Agent Cloud, it is an Airbyte object found here: 'https://airbyte-public-api-docs.s3.us-east-2.amazonaws.com/rapidoc-api-docs.html#post-/v1/sources/discover_schema'
This is an Airbyte object used to describe the stream between the datasource and Agent Cloud, it holds the properties of it, more information can be found on the Airbyte Reference here: 'https://reference.airbyte.com/reference/getstreamproperties'