cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/employees" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"employee": {
"name": "Jane Citizen"
}
}'from exsited import build_client
client = build_client()
response = client.employees.create_employee({"employee": {"name": "Jane Citizen"}})
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.employees.createEmployee({employee: {name: 'Jane Citizen'}});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->employees->createEmployee(['employee' => ['name' => 'Jane Citizen']]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.employees.employees_dto.EmployeesDto.Employee;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<Employee> response = client.employees().createEmployee(
Map.of("employee", Map.of("name", "Jane Citizen")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Employees.CreateEmployeeAsync(new Dictionary<string, object?>
{
["employee"] = new Dictionary<string, object?>
{
["name"] = "Jane Citizen",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.employees.createEmployee({
'employee': {'name': 'Jane Citizen'},
});
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.Employees().CreateEmployee(context.Background(), map[string]any{
"employee": map[string]any{"name": "Jane Citizen"},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"employee": {
"activity_logs": "<array>",
"code": "<string>",
"contacts": [
{
"address": null,
"created_by": {
"name": "<string>",
"object": "<string>"
},
"created_on": "<string>",
"email": {
"address": "<string>",
"email_opted_out": true
},
"fax": null,
"id": "<string>",
"last_updated_by": null,
"last_updated_on": null,
"mobile": null,
"name": {
"designation": null,
"first": "<string>",
"last": "<string>",
"middle": null,
"salutation": null
},
"object": "<string>",
"phone": null,
"status": "<string>",
"type": "<string>",
"version": 123
}
],
"created_by": {
"name": "<string>",
"object": "<string>"
},
"created_on": "<string>",
"custom_attributes": "<array>",
"custom_form": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"description": "<string>",
"display_name": "<string>",
"email_address": "<string>",
"href": "<string>",
"id": "<string>",
"image_uuid": null,
"last_updated_by": {
"name": "<string>",
"object": "<string>"
},
"last_updated_on": "<string>",
"name": "<string>",
"object": "<string>",
"status": "<string>",
"version": 123
}
}Employees
Create an employee
Creates an employee and returns it under employee.
POST
/
employees
cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/employees" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"employee": {
"name": "Jane Citizen"
}
}'from exsited import build_client
client = build_client()
response = client.employees.create_employee({"employee": {"name": "Jane Citizen"}})
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.employees.createEmployee({employee: {name: 'Jane Citizen'}});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->employees->createEmployee(['employee' => ['name' => 'Jane Citizen']]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.employees.employees_dto.EmployeesDto.Employee;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<Employee> response = client.employees().createEmployee(
Map.of("employee", Map.of("name", "Jane Citizen")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Employees.CreateEmployeeAsync(new Dictionary<string, object?>
{
["employee"] = new Dictionary<string, object?>
{
["name"] = "Jane Citizen",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.employees.createEmployee({
'employee': {'name': 'Jane Citizen'},
});
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.Employees().CreateEmployee(context.Background(), map[string]any{
"employee": map[string]any{"name": "Jane Citizen"},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"employee": {
"activity_logs": "<array>",
"code": "<string>",
"contacts": [
{
"address": null,
"created_by": {
"name": "<string>",
"object": "<string>"
},
"created_on": "<string>",
"email": {
"address": "<string>",
"email_opted_out": true
},
"fax": null,
"id": "<string>",
"last_updated_by": null,
"last_updated_on": null,
"mobile": null,
"name": {
"designation": null,
"first": "<string>",
"last": "<string>",
"middle": null,
"salutation": null
},
"object": "<string>",
"phone": null,
"status": "<string>",
"type": "<string>",
"version": 123
}
],
"created_by": {
"name": "<string>",
"object": "<string>"
},
"created_on": "<string>",
"custom_attributes": "<array>",
"custom_form": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"description": "<string>",
"display_name": "<string>",
"email_address": "<string>",
"href": "<string>",
"id": "<string>",
"image_uuid": null,
"last_updated_by": {
"name": "<string>",
"object": "<string>"
},
"last_updated_on": "<string>",
"name": "<string>",
"object": "<string>",
"status": "<string>",
"version": 123
}
}Send the new employee under
employee with at least a name. The new employee comes back under employee, with its emp_ id and its code.
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.