cURL
curl --request POST \
--url https://platform.versori.com/api/switchboard/v1alpha1/organisations/{organisationId}/connections \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My API Key",
"appId": "01G01QZNWG0000000000000000",
"authType": "apikey",
"data": {
"apiKey": "my-secret-key"
}
}
'import requests
url = "https://platform.versori.com/api/switchboard/v1alpha1/organisations/{organisationId}/connections"
payload = {
"name": "My API Key",
"appId": "01G01QZNWG0000000000000000",
"authType": "apikey",
"data": { "apiKey": "my-secret-key" }
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'My API Key',
appId: '01G01QZNWG0000000000000000',
authType: 'apikey',
data: {apiKey: 'my-secret-key'}
})
};
fetch('https://platform.versori.com/api/switchboard/v1alpha1/organisations/{organisationId}/connections', 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://platform.versori.com/api/switchboard/v1alpha1/organisations/{organisationId}/connections",
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([
'name' => 'My API Key',
'appId' => '01G01QZNWG0000000000000000',
'authType' => 'apikey',
'data' => [
'apiKey' => 'my-secret-key'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://platform.versori.com/api/switchboard/v1alpha1/organisations/{organisationId}/connections"
payload := strings.NewReader("{\n \"name\": \"My API Key\",\n \"appId\": \"01G01QZNWG0000000000000000\",\n \"authType\": \"apikey\",\n \"data\": {\n \"apiKey\": \"my-secret-key\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://platform.versori.com/api/switchboard/v1alpha1/organisations/{organisationId}/connections")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My API Key\",\n \"appId\": \"01G01QZNWG0000000000000000\",\n \"authType\": \"apikey\",\n \"data\": {\n \"apiKey\": \"my-secret-key\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.versori.com/api/switchboard/v1alpha1/organisations/{organisationId}/connections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"My API Key\",\n \"appId\": \"01G01QZNWG0000000000000000\",\n \"authType\": \"apikey\",\n \"data\": {\n \"apiKey\": \"my-secret-key\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"orgId": "<string>",
"name": "<string>",
"app": {
"id": "<string>",
"orgId": "<string>",
"name": "<string>",
"public": true,
"server": {
"name": "<string>",
"url": "<string>"
},
"schemaMetadata": {
"type": "<string>",
"version": "<string>",
"url": "<string>"
},
"schema": {
"id": "<string>",
"type": "<string>",
"version": "<string>",
"sourceUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"supportedAuthConfigs": [
{
"type": "<string>",
"isValid": true,
"data": {
"discoveryUrl": "<string>",
"clientId": "<string>",
"clientSecret": "<string>",
"scopes": {}
}
}
],
"imageUrl": "<string>",
"schemaId": "<string>",
"deletedAt": "2023-11-07T05:31:56Z"
},
"credentialId": "<string>",
"authConfig": {
"type": "<string>",
"isValid": true,
"data": {
"discoveryUrl": "<string>",
"clientId": "<string>",
"clientSecret": "<string>",
"scopes": {}
}
},
"usedByBoards": [
{
"id": "<string>",
"name": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"extensions": {}
}connections
Post organisations connections
Creates a connection between an organisation and an App. This is to be used by authentication methods which the user can explicitly configure, such as API Key and Basic Auth. For OAuth2/OIDC connections, users should call the InitialiseConnection endpoint instead.
POST
/
organisations
/
{organisationId}
/
connections
cURL
curl --request POST \
--url https://platform.versori.com/api/switchboard/v1alpha1/organisations/{organisationId}/connections \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My API Key",
"appId": "01G01QZNWG0000000000000000",
"authType": "apikey",
"data": {
"apiKey": "my-secret-key"
}
}
'import requests
url = "https://platform.versori.com/api/switchboard/v1alpha1/organisations/{organisationId}/connections"
payload = {
"name": "My API Key",
"appId": "01G01QZNWG0000000000000000",
"authType": "apikey",
"data": { "apiKey": "my-secret-key" }
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'My API Key',
appId: '01G01QZNWG0000000000000000',
authType: 'apikey',
data: {apiKey: 'my-secret-key'}
})
};
fetch('https://platform.versori.com/api/switchboard/v1alpha1/organisations/{organisationId}/connections', 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://platform.versori.com/api/switchboard/v1alpha1/organisations/{organisationId}/connections",
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([
'name' => 'My API Key',
'appId' => '01G01QZNWG0000000000000000',
'authType' => 'apikey',
'data' => [
'apiKey' => 'my-secret-key'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://platform.versori.com/api/switchboard/v1alpha1/organisations/{organisationId}/connections"
payload := strings.NewReader("{\n \"name\": \"My API Key\",\n \"appId\": \"01G01QZNWG0000000000000000\",\n \"authType\": \"apikey\",\n \"data\": {\n \"apiKey\": \"my-secret-key\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://platform.versori.com/api/switchboard/v1alpha1/organisations/{organisationId}/connections")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My API Key\",\n \"appId\": \"01G01QZNWG0000000000000000\",\n \"authType\": \"apikey\",\n \"data\": {\n \"apiKey\": \"my-secret-key\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.versori.com/api/switchboard/v1alpha1/organisations/{organisationId}/connections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"My API Key\",\n \"appId\": \"01G01QZNWG0000000000000000\",\n \"authType\": \"apikey\",\n \"data\": {\n \"apiKey\": \"my-secret-key\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"orgId": "<string>",
"name": "<string>",
"app": {
"id": "<string>",
"orgId": "<string>",
"name": "<string>",
"public": true,
"server": {
"name": "<string>",
"url": "<string>"
},
"schemaMetadata": {
"type": "<string>",
"version": "<string>",
"url": "<string>"
},
"schema": {
"id": "<string>",
"type": "<string>",
"version": "<string>",
"sourceUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"supportedAuthConfigs": [
{
"type": "<string>",
"isValid": true,
"data": {
"discoveryUrl": "<string>",
"clientId": "<string>",
"clientSecret": "<string>",
"scopes": {}
}
}
],
"imageUrl": "<string>",
"schemaId": "<string>",
"deletedAt": "2023-11-07T05:31:56Z"
},
"credentialId": "<string>",
"authConfig": {
"type": "<string>",
"isValid": true,
"data": {
"discoveryUrl": "<string>",
"clientId": "<string>",
"clientSecret": "<string>",
"scopes": {}
}
},
"usedByBoards": [
{
"id": "<string>",
"name": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"extensions": {}
}Authorizations
Path Parameters
Body
application/json
CreateConnectionRequest is the payload for creating a new Connection.
CreateConnectionRequestBody is the request body to create a new connection. The ID is automatically generated and the organisation ID is defined by the request's path parameter.
Response
A single Connection result.
⌘I