cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/external_databases" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"external_database": {
"name": "acmedb",
"tables": [
{
"table_name": "contacts",
"fields": [
"company"
],
"records": [
{
"record": [
{
"field": "company",
"value": "Acme Pty Ltd"
}
]
}
]
}
]
}
}'from exsited import build_client
client = build_client()
response = client.external_databases.create_external_database(
{
"external_database": {
"name": "acmedb",
"tables": [
{
"table_name": "contacts",
"fields": ["company"],
"records": [
{"record": [{"field": "company", "value": "Acme Pty Ltd"}]}
],
}
],
}
}
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.externalDatabases.createExternalDatabase({
external_database: {
name: 'acmedb',
tables: [
{
table_name: 'contacts',
fields: ['company'],
records: [{record: [{field: 'company', value: 'Acme Pty Ltd'}]}],
},
],
},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->externalDatabases->createExternalDatabase([
'external_database' => [
'name' => 'acmedb',
'tables' => [
[
'table_name' => 'contacts',
'fields' => ['company'],
'records' => [['record' => [['field' => 'company', 'value' => 'Acme Pty Ltd']]]],
],
],
],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.external_databases.external_databases_dto.ExternalDatabasesDto.ExternalDatabasesView;
import java.util.List;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<ExternalDatabasesView> response = client.externalDatabases().createExternalDatabase(
Map.of(
"external_database", Map.of(
"name", "acmedb",
"tables", List.of(
Map.of(
"table_name", "contacts",
"fields", List.of("company"),
"records", List.of(
Map.of(
"record", List.of(
Map.of(
"field", "company",
"value", "Acme Pty Ltd")))))))));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.ExternalDatabases.CreateExternalDatabaseAsync(new Dictionary<string, object?>
{
["external_database"] = new Dictionary<string, object?>
{
["name"] = "acmedb",
["tables"] = new List<object?>
{
new Dictionary<string, object?>
{
["table_name"] = "contacts",
["fields"] = new List<object?>
{
"company",
},
["records"] = new List<object?>
{
new Dictionary<string, object?>
{
["record"] = new List<object?>
{
new Dictionary<string, object?>
{
["field"] = "company",
["value"] = "Acme Pty Ltd",
},
},
},
},
},
},
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.externalDatabases.createExternalDatabase({
'external_database': {
'name': 'acmedb',
'tables': [
{
'table_name': 'contacts',
'fields': ['company'],
'records': [
{
'record': [
{'field': 'company', 'value': 'Acme Pty Ltd'},
],
},
],
},
],
},
});
print(response.map);
import (
"context"
"fmt"
"log"
exsited "github.com/exsited/exsited-sdk-go/v4"
)
client, err := exsited.BuildClient(nil)
if err != nil {
log.Fatal(err)
}
defer client.Close()
response, err := client.ExternalDatabases().CreateExternalDatabase(context.Background(), map[string]any{
"external_database": map[string]any{
"name": "acmedb",
"tables": []any{
map[string]any{
"table_name": "contacts",
"fields": []any{"company"},
"records": []any{
map[string]any{
"record": []any{
map[string]any{"field": "company", "value": "Acme Pty Ltd"},
},
},
},
},
},
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"external_database": {
"name": "<string>",
"message": "<string>",
"activity_logs": [
{}
]
}
}External databases
Create an external database
Creates a database with its tables and first records, and returns its name and a message.
POST
/
external_databases
cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/external_databases" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"external_database": {
"name": "acmedb",
"tables": [
{
"table_name": "contacts",
"fields": [
"company"
],
"records": [
{
"record": [
{
"field": "company",
"value": "Acme Pty Ltd"
}
]
}
]
}
]
}
}'from exsited import build_client
client = build_client()
response = client.external_databases.create_external_database(
{
"external_database": {
"name": "acmedb",
"tables": [
{
"table_name": "contacts",
"fields": ["company"],
"records": [
{"record": [{"field": "company", "value": "Acme Pty Ltd"}]}
],
}
],
}
}
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.externalDatabases.createExternalDatabase({
external_database: {
name: 'acmedb',
tables: [
{
table_name: 'contacts',
fields: ['company'],
records: [{record: [{field: 'company', value: 'Acme Pty Ltd'}]}],
},
],
},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->externalDatabases->createExternalDatabase([
'external_database' => [
'name' => 'acmedb',
'tables' => [
[
'table_name' => 'contacts',
'fields' => ['company'],
'records' => [['record' => [['field' => 'company', 'value' => 'Acme Pty Ltd']]]],
],
],
],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.external_databases.external_databases_dto.ExternalDatabasesDto.ExternalDatabasesView;
import java.util.List;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<ExternalDatabasesView> response = client.externalDatabases().createExternalDatabase(
Map.of(
"external_database", Map.of(
"name", "acmedb",
"tables", List.of(
Map.of(
"table_name", "contacts",
"fields", List.of("company"),
"records", List.of(
Map.of(
"record", List.of(
Map.of(
"field", "company",
"value", "Acme Pty Ltd")))))))));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.ExternalDatabases.CreateExternalDatabaseAsync(new Dictionary<string, object?>
{
["external_database"] = new Dictionary<string, object?>
{
["name"] = "acmedb",
["tables"] = new List<object?>
{
new Dictionary<string, object?>
{
["table_name"] = "contacts",
["fields"] = new List<object?>
{
"company",
},
["records"] = new List<object?>
{
new Dictionary<string, object?>
{
["record"] = new List<object?>
{
new Dictionary<string, object?>
{
["field"] = "company",
["value"] = "Acme Pty Ltd",
},
},
},
},
},
},
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.externalDatabases.createExternalDatabase({
'external_database': {
'name': 'acmedb',
'tables': [
{
'table_name': 'contacts',
'fields': ['company'],
'records': [
{
'record': [
{'field': 'company', 'value': 'Acme Pty Ltd'},
],
},
],
},
],
},
});
print(response.map);
import (
"context"
"fmt"
"log"
exsited "github.com/exsited/exsited-sdk-go/v4"
)
client, err := exsited.BuildClient(nil)
if err != nil {
log.Fatal(err)
}
defer client.Close()
response, err := client.ExternalDatabases().CreateExternalDatabase(context.Background(), map[string]any{
"external_database": map[string]any{
"name": "acmedb",
"tables": []any{
map[string]any{
"table_name": "contacts",
"fields": []any{"company"},
"records": []any{
map[string]any{
"record": []any{
map[string]any{"field": "company", "value": "Acme Pty Ltd"},
},
},
},
},
},
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"external_database": {
"name": "<string>",
"message": "<string>",
"activity_logs": [
{}
]
}
}Send the database under
external_database: a name and a tables array, where each table has a table_name, its fields (column names) and its first records. Set replace to true to recreate a database that already exists with the tables in the body. The response holds the name, a message and activity_logs under external_database.
The SDK samples get their client from credentials your app registers once when it starts, as shown in Authentication. To try the call here, click Try it, set
host to your Exsited API host name and paste an access token from Get an access token. To send a raw JSON body instead of filling in fields, copy the cURL sample and edit its -d payload.Authorizations
An access token from POST /api/v4/oauth2/token. The SDKs get and renew it for you.
Body
application/json
Show child attributes
Show child attributes
Response
201 - application/json
The database is created; its name and a message, under external_database.
Show child attributes
Show child attributes