Connect a source
curl --request POST \
--url https://api.conare.ai/sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "hubspot",
"namespace": "crm",
"redirect_url": "https://yourapp.com/settings"
}
'import requests
url = "https://api.conare.ai/sources"
payload = {
"type": "hubspot",
"namespace": "crm",
"redirect_url": "https://yourapp.com/settings"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'hubspot',
namespace: 'crm',
redirect_url: 'https://yourapp.com/settings'
})
};
fetch('https://api.conare.ai/sources', 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://api.conare.ai/sources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'hubspot',
'namespace' => 'crm',
'redirect_url' => 'https://yourapp.com/settings'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/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://api.conare.ai/sources"
payload := strings.NewReader("{\n \"type\": \"hubspot\",\n \"namespace\": \"crm\",\n \"redirect_url\": \"https://yourapp.com/settings\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/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://api.conare.ai/sources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"hubspot\",\n \"namespace\": \"crm\",\n \"redirect_url\": \"https://yourapp.com/settings\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.conare.ai/sources")
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"] = 'application/json'
request.body = "{\n \"type\": \"hubspot\",\n \"namespace\": \"crm\",\n \"redirect_url\": \"https://yourapp.com/settings\"\n}"
response = http.request(request)
puts response.read_body{
"source": {
"id": "src_2b9c1f",
"type": "hubspot",
"name": "HubSpot",
"namespace": "docs",
"status": "connecting",
"error": "<string>",
"documents": 123,
"last_synced_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
},
"connect_url": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "text is required",
"request_id": "req_8f3a2c"
}
}{
"error": {
"code": "invalid_request",
"message": "text is required",
"request_id": "req_8f3a2c"
}
}{
"error": {
"code": "invalid_request",
"message": "text is required",
"request_id": "req_8f3a2c"
}
}Sources
Connect a source
Creates a source in connecting and returns connect_url, a hosted page where the person
who owns the app account signs in. Send your own users there to connect their apps into
their own namespace (for example user-42). They come back to redirect_url (default: the
source’s page in the console). Conare then syncs the app into the namespace on a schedule.
POST
/
sources
Connect a source
curl --request POST \
--url https://api.conare.ai/sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "hubspot",
"namespace": "crm",
"redirect_url": "https://yourapp.com/settings"
}
'import requests
url = "https://api.conare.ai/sources"
payload = {
"type": "hubspot",
"namespace": "crm",
"redirect_url": "https://yourapp.com/settings"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'hubspot',
namespace: 'crm',
redirect_url: 'https://yourapp.com/settings'
})
};
fetch('https://api.conare.ai/sources', 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://api.conare.ai/sources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'hubspot',
'namespace' => 'crm',
'redirect_url' => 'https://yourapp.com/settings'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/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://api.conare.ai/sources"
payload := strings.NewReader("{\n \"type\": \"hubspot\",\n \"namespace\": \"crm\",\n \"redirect_url\": \"https://yourapp.com/settings\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/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://api.conare.ai/sources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"hubspot\",\n \"namespace\": \"crm\",\n \"redirect_url\": \"https://yourapp.com/settings\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.conare.ai/sources")
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"] = 'application/json'
request.body = "{\n \"type\": \"hubspot\",\n \"namespace\": \"crm\",\n \"redirect_url\": \"https://yourapp.com/settings\"\n}"
response = http.request(request)
puts response.read_body{
"source": {
"id": "src_2b9c1f",
"type": "hubspot",
"name": "HubSpot",
"namespace": "docs",
"status": "connecting",
"error": "<string>",
"documents": 123,
"last_synced_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
},
"connect_url": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "text is required",
"request_id": "req_8f3a2c"
}
}{
"error": {
"code": "invalid_request",
"message": "text is required",
"request_id": "req_8f3a2c"
}
}{
"error": {
"code": "invalid_request",
"message": "text is required",
"request_id": "req_8f3a2c"
}
}Authorizations
An API key from conare.ai/console/keys. It can read and write every namespace in its organization.
Body
application/json