SSE server proxy endpoint - Barndoor Documentation
SSE server proxy endpoint
cURL
curl --request GET \
--url https://your-org.platform.barndoor.ai/sse/{mcp_server_name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event_types": [\
"data_update",\
"status_change"\
],
"filters": {
"object_type": "Account",
"limit": 100
}
}
'
Python
import requests
url = "https://your-org.platform.barndoor.ai/sse/{mcp_server_name}"
payload = {
"event_types": ["data_update", "status_change"],
"filters": {
"object_type": "Account",
"limit": 100
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)
JavaScript (Fetch)
const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event_types: ['data_update', 'status_change'],
filters: {object_type: 'Account', limit: 100}
})
};
fetch('https://your-org.platform.barndoor.ai/sse/{mcp_server_name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your-org.platform.barndoor.ai/sse/{mcp_server_name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'event_types' => [
'data_update',
'status_change'
],
'filters' => [
'object_type' => 'Account',
'limit' => 100
]
]),
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;
}
?>
Go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-org.platform.barndoor.ai/sse/{mcp_server_name}"
payload := strings.NewReader("{\n \"event_types\": [\n \"data_update\",
\"status_change\"\n ],\n \"filters\": {\n \"object_type\": \"Account\",\n \"limit\": 100\n }\n}")
req, _ := http.NewRequest("GET", 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))
}
Response Codes
- 200: Successful response
- 401: Unauthorized
- 403: Forbidden
- 404: Not Found
- 500: Internal Server Error
- 502: Bad Gateway
Error Examples
{
"error": "ServerNotFound",
"message": "Server with ID '123' not found",
"details": {}
}
{
"error": "ServerNotConnected",
"message": "Server 'salesforce' is not connected. Please initiate connection first."
}
Authorizations
Authorization
- Required: JWT token obtained through Barndoor's OAuth 2.0 authorization-code flow with PKCE.
- Format:
Authorization: Bearer <your-jwt-token>.