cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/settings/zones" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"zone": {
"name": "Australia and New Zealand",
"country_list": [
"country_4f3e2d1c0b0a99887766554433221100"
]
}
}'from exsited import build_client
client = build_client()
response = client.zones.create_settings_zone(
{
"zone": {
"name": "Australia and New Zealand",
"country_list": ["country_4f3e2d1c0b0a99887766554433221100"],
}
}
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.zones.createSettingsZone({
zone: {name: 'Australia and New Zealand', country_list: ['country_4f3e2d1c0b0a99887766554433221100']},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->zones->createSettingsZone([
'zone' => [
'name' => 'Australia and New Zealand',
'country_list' => ['country_4f3e2d1c0b0a99887766554433221100'],
],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.zones.zones_dto.ZonesDto.SettingsZone;
import java.util.List;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<SettingsZone> response = client.zones().createSettingsZone(
Map.of(
"zone", Map.of(
"name", "Australia and New Zealand",
"country_list", List.of("country_4f3e2d1c0b0a99887766554433221100"))));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Zones.CreateSettingsZoneAsync(new Dictionary<string, object?>
{
["zone"] = new Dictionary<string, object?>
{
["name"] = "Australia and New Zealand",
["country_list"] = new List<object?>
{
"country_4f3e2d1c0b0a99887766554433221100",
},
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.zones.createSettingsZone({
'zone': {
'name': 'Australia and New Zealand',
'country_list': ['country_4f3e2d1c0b0a99887766554433221100'],
},
});
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.Zones().CreateSettingsZone(context.Background(), map[string]any{
"zone": map[string]any{
"name": "Australia and New Zealand",
"country_list": []any{"country_4f3e2d1c0b0a99887766554433221100"},
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"zone": {
"created_by": "<unknown>",
"created_on": "<string>",
"description": "<string>",
"display_name": "<string>",
"href": "<string>",
"id": "<string>",
"last_updated_by": "<unknown>",
"last_updated_on": "<string>",
"name": "<string>",
"object": "<string>",
"status": "<string>"
}
}Zones
Create a zone
Creates a zone from a name and a list of countries, and returns it.
POST
/
settings
/
zones
cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/settings/zones" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"zone": {
"name": "Australia and New Zealand",
"country_list": [
"country_4f3e2d1c0b0a99887766554433221100"
]
}
}'from exsited import build_client
client = build_client()
response = client.zones.create_settings_zone(
{
"zone": {
"name": "Australia and New Zealand",
"country_list": ["country_4f3e2d1c0b0a99887766554433221100"],
}
}
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.zones.createSettingsZone({
zone: {name: 'Australia and New Zealand', country_list: ['country_4f3e2d1c0b0a99887766554433221100']},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->zones->createSettingsZone([
'zone' => [
'name' => 'Australia and New Zealand',
'country_list' => ['country_4f3e2d1c0b0a99887766554433221100'],
],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.zones.zones_dto.ZonesDto.SettingsZone;
import java.util.List;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<SettingsZone> response = client.zones().createSettingsZone(
Map.of(
"zone", Map.of(
"name", "Australia and New Zealand",
"country_list", List.of("country_4f3e2d1c0b0a99887766554433221100"))));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Zones.CreateSettingsZoneAsync(new Dictionary<string, object?>
{
["zone"] = new Dictionary<string, object?>
{
["name"] = "Australia and New Zealand",
["country_list"] = new List<object?>
{
"country_4f3e2d1c0b0a99887766554433221100",
},
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.zones.createSettingsZone({
'zone': {
'name': 'Australia and New Zealand',
'country_list': ['country_4f3e2d1c0b0a99887766554433221100'],
},
});
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.Zones().CreateSettingsZone(context.Background(), map[string]any{
"zone": map[string]any{
"name": "Australia and New Zealand",
"country_list": []any{"country_4f3e2d1c0b0a99887766554433221100"},
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"zone": {
"created_by": "<unknown>",
"created_on": "<string>",
"description": "<string>",
"display_name": "<string>",
"href": "<string>",
"id": "<string>",
"last_updated_by": "<unknown>",
"last_updated_on": "<string>",
"name": "<string>",
"object": "<string>",
"status": "<string>"
}
}Send the zone under
zone with its name and a country_list of one or more country ids.
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.