cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/custom_attributes" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"custom_attribute": {
"name": "contract_tier",
"display_name": "Contract tier",
"type": "STRING"
}
}'from exsited import build_client
client = build_client()
response = client.custom_attributes.create_custom_attribute(
{
"custom_attribute": {
"name": "contract_tier",
"display_name": "Contract tier",
"type": "STRING",
}
}
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.customAttributes.createCustomAttribute({
custom_attribute: {name: 'contract_tier', display_name: 'Contract tier', type: 'STRING'},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->customAttributes->createCustomAttribute([
'custom_attribute' => [
'name' => 'contract_tier',
'display_name' => 'Contract tier',
'type' => 'STRING',
],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.custom_attributes.custom_attributes_dto.CustomAttributesDto;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<CustomAttributesDto.CustomAttributes> response = client.customAttributes().createCustomAttribute(
Map.of(
"custom_attribute", Map.of(
"name", "contract_tier",
"display_name", "Contract tier",
"type", "STRING")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.CustomAttributes.CreateCustomAttributeAsync(new Dictionary<string, object?>
{
["custom_attribute"] = new Dictionary<string, object?>
{
["name"] = "contract_tier",
["display_name"] = "Contract tier",
["type"] = "STRING",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.customAttributes.createCustomAttribute({
'custom_attribute': {
'name': 'contract_tier',
'display_name': 'Contract tier',
'type': 'STRING',
},
});
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.CustomAttributes().CreateCustomAttribute(context.Background(), map[string]any{
"custom_attribute": map[string]any{
"name": "contract_tier",
"display_name": "Contract tier",
"type": "STRING",
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"custom_attribute": {
"object": "<string>",
"id": "<string>",
"status": "<string>",
"name": "<string>",
"display_name": "<string>",
"type": "<string>",
"description": "<string>",
"is_mandatory": true,
"encrypt_data": true,
"unit": "<unknown>",
"uom": "<unknown>",
"min_value": "<unknown>",
"max_value": "<unknown>",
"max_length": 123,
"max_size": "<unknown>",
"include_seconds": "<unknown>",
"time_format": "<unknown>",
"options": [
{
"display_order": 123,
"name": "<string>"
}
],
"use_in": [
{
"associated_account_groups": [
{}
],
"associated_item_groups": [
{}
],
"associated_user_groups": [
{}
],
"enabled": true,
"required": true,
"resource": "<string>",
"unique": true
}
],
"meta_data": "<string>",
"created_on": "<string>",
"last_updated_on": "<string>",
"created_by": "<unknown>",
"last_updated_by": "<unknown>",
"version": 123,
"href": "<string>",
"uuid": "<string>",
"activity_logs": [
{
"activity": "<string>"
}
]
}
}Custom attributes
Create a custom attribute
Creates a custom attribute and returns it, under custom_attribute.
POST
/
custom_attributes
cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/custom_attributes" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"custom_attribute": {
"name": "contract_tier",
"display_name": "Contract tier",
"type": "STRING"
}
}'from exsited import build_client
client = build_client()
response = client.custom_attributes.create_custom_attribute(
{
"custom_attribute": {
"name": "contract_tier",
"display_name": "Contract tier",
"type": "STRING",
}
}
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.customAttributes.createCustomAttribute({
custom_attribute: {name: 'contract_tier', display_name: 'Contract tier', type: 'STRING'},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->customAttributes->createCustomAttribute([
'custom_attribute' => [
'name' => 'contract_tier',
'display_name' => 'Contract tier',
'type' => 'STRING',
],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.custom_attributes.custom_attributes_dto.CustomAttributesDto;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<CustomAttributesDto.CustomAttributes> response = client.customAttributes().createCustomAttribute(
Map.of(
"custom_attribute", Map.of(
"name", "contract_tier",
"display_name", "Contract tier",
"type", "STRING")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.CustomAttributes.CreateCustomAttributeAsync(new Dictionary<string, object?>
{
["custom_attribute"] = new Dictionary<string, object?>
{
["name"] = "contract_tier",
["display_name"] = "Contract tier",
["type"] = "STRING",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.customAttributes.createCustomAttribute({
'custom_attribute': {
'name': 'contract_tier',
'display_name': 'Contract tier',
'type': 'STRING',
},
});
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.CustomAttributes().CreateCustomAttribute(context.Background(), map[string]any{
"custom_attribute": map[string]any{
"name": "contract_tier",
"display_name": "Contract tier",
"type": "STRING",
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"custom_attribute": {
"object": "<string>",
"id": "<string>",
"status": "<string>",
"name": "<string>",
"display_name": "<string>",
"type": "<string>",
"description": "<string>",
"is_mandatory": true,
"encrypt_data": true,
"unit": "<unknown>",
"uom": "<unknown>",
"min_value": "<unknown>",
"max_value": "<unknown>",
"max_length": 123,
"max_size": "<unknown>",
"include_seconds": "<unknown>",
"time_format": "<unknown>",
"options": [
{
"display_order": 123,
"name": "<string>"
}
],
"use_in": [
{
"associated_account_groups": [
{}
],
"associated_item_groups": [
{}
],
"associated_user_groups": [
{}
],
"enabled": true,
"required": true,
"resource": "<string>",
"unique": true
}
],
"meta_data": "<string>",
"created_on": "<string>",
"last_updated_on": "<string>",
"created_by": "<unknown>",
"last_updated_by": "<unknown>",
"version": 123,
"href": "<string>",
"uuid": "<string>",
"activity_logs": [
{
"activity": "<string>"
}
]
}
}Defines a new custom attribute. Send
name, display_name and type under custom_attribute; for a DROPDOWN attribute add options as a list of strings. The new attribute comes back with its id, uuid and activity_logs.
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 new custom attribute, under custom_attribute.
Show child attributes
Show child attributes