cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/external_databases/acmedb/insert_records" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"table_name": "contacts",
"records": [
{
"record": [
{
"field": "company",
"value": "Example Holdings"
}
]
}
]
}'from exsited import build_client
client = build_client()
response = client.external_databases.create_external_database_insert_record(
"acmedb",
{
"table_name": "contacts",
"records": [{"record": [{"field": "company", "value": "Example Holdings"}]}],
},
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.externalDatabases.createExternalDatabaseInsertRecord('acmedb', {
table_name: 'contacts',
records: [{record: [{field: 'company', value: 'Example Holdings'}]}],
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->externalDatabases->createExternalDatabaseInsertRecord('acmedb', [
'table_name' => 'contacts',
'records' => [['record' => [['field' => 'company', 'value' => 'Example Holdings']]]],
]);
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.ExternalDatabaseInsertRecord;
import java.util.List;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<ExternalDatabaseInsertRecord> response = client.externalDatabases().createExternalDatabaseInsertRecord(
"acmedb",
Map.of(
"table_name", "contacts",
"records", List.of(
Map.of(
"record", List.of(
Map.of("field", "company", "value", "Example Holdings"))))));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.ExternalDatabases.CreateExternalDatabaseInsertRecordAsync(
"acmedb",
new Dictionary<string, object?>
{
["table_name"] = "contacts",
["records"] = new List<object?>
{
new Dictionary<string, object?>
{
["record"] = new List<object?>
{
new Dictionary<string, object?>
{
["field"] = "company",
["value"] = "Example Holdings",
},
},
},
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.externalDatabases
.createExternalDatabaseInsertRecord('acmedb', {
'table_name': 'contacts',
'records': [
{
'record': [
{'field': 'company', 'value': 'Example Holdings'},
],
},
],
});
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().CreateExternalDatabaseInsertRecord(context.Background(), "acmedb", map[string]any{
"table_name": "contacts",
"records": []any{
map[string]any{
"record": []any{
map[string]any{
"field": "company",
"value": "Example Holdings",
},
},
},
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"external_database": {
"success": true,
"message": "<string>",
"inserted_data": [
{}
]
}
}External databases
Insert records into an external database table
Adds rows to one table of a database and returns the inserted data.
POST
/
external_databases
/
{db_name}
/
insert_records
cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/external_databases/acmedb/insert_records" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"table_name": "contacts",
"records": [
{
"record": [
{
"field": "company",
"value": "Example Holdings"
}
]
}
]
}'from exsited import build_client
client = build_client()
response = client.external_databases.create_external_database_insert_record(
"acmedb",
{
"table_name": "contacts",
"records": [{"record": [{"field": "company", "value": "Example Holdings"}]}],
},
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.externalDatabases.createExternalDatabaseInsertRecord('acmedb', {
table_name: 'contacts',
records: [{record: [{field: 'company', value: 'Example Holdings'}]}],
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->externalDatabases->createExternalDatabaseInsertRecord('acmedb', [
'table_name' => 'contacts',
'records' => [['record' => [['field' => 'company', 'value' => 'Example Holdings']]]],
]);
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.ExternalDatabaseInsertRecord;
import java.util.List;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<ExternalDatabaseInsertRecord> response = client.externalDatabases().createExternalDatabaseInsertRecord(
"acmedb",
Map.of(
"table_name", "contacts",
"records", List.of(
Map.of(
"record", List.of(
Map.of("field", "company", "value", "Example Holdings"))))));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.ExternalDatabases.CreateExternalDatabaseInsertRecordAsync(
"acmedb",
new Dictionary<string, object?>
{
["table_name"] = "contacts",
["records"] = new List<object?>
{
new Dictionary<string, object?>
{
["record"] = new List<object?>
{
new Dictionary<string, object?>
{
["field"] = "company",
["value"] = "Example Holdings",
},
},
},
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.externalDatabases
.createExternalDatabaseInsertRecord('acmedb', {
'table_name': 'contacts',
'records': [
{
'record': [
{'field': 'company', 'value': 'Example Holdings'},
],
},
],
});
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().CreateExternalDatabaseInsertRecord(context.Background(), "acmedb", map[string]any{
"table_name": "contacts",
"records": []any{
map[string]any{
"record": []any{
map[string]any{
"field": "company",
"value": "Example Holdings",
},
},
},
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"external_database": {
"success": true,
"message": "<string>",
"inserted_data": [
{}
]
}
}Send the
table_name and a records array at the top level of the body, with no wrapper key. Each record is a list of field and value pairs. The response holds success, a message and inserted_data 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.
Path Parameters
The database's name, as given when it is created, such as acmedb.
Response
200 - application/json
The rows are added; the result under external_database.
Show child attributes
Show child attributes