cURL
curl -X PATCH "$EXSITED_BASE_URL/api/v4/employees/emp_7b3c9d1e2f4a4b5c8d6e7f8091a2b3c4" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"employee": {
"description": "Senior technician"
}
}'from exsited import build_client
client = build_client()
response = client.employees.update_employee(
"emp_7b3c9d1e2f4a4b5c8d6e7f8091a2b3c4",
{"employee": {"description": "Senior technician"}},
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.employees.updateEmployee('emp_7b3c9d1e2f4a4b5c8d6e7f8091a2b3c4', {
employee: {description: 'Senior technician'},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->employees->updateEmployee('emp_7b3c9d1e2f4a4b5c8d6e7f8091a2b3c4', [
'employee' => ['description' => 'Senior technician'],
]);
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().updateEmployee(
"emp_7b3c9d1e2f4a4b5c8d6e7f8091a2b3c4",
Map.of("employee", Map.of("description", "Senior technician")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Employees.UpdateEmployeeAsync(
"emp_7b3c9d1e2f4a4b5c8d6e7f8091a2b3c4",
new Dictionary<string, object?>
{
["employee"] = new Dictionary<string, object?>
{
["description"] = "Senior technician",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.employees.updateEmployee(
'emp_7b3c9d1e2f4a4b5c8d6e7f8091a2b3c4',
{
'employee': {'description': 'Senior technician'},
},
);
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().UpdateEmployee(context.Background(), "emp_7b3c9d1e2f4a4b5c8d6e7f8091a2b3c4", map[string]any{
"employee": map[string]any{"description": "Senior technician"},
}, 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
Update an employee
Updates an employee and returns it under employee.
PATCH
/
employees
/
{employee_id}
cURL
curl -X PATCH "$EXSITED_BASE_URL/api/v4/employees/emp_7b3c9d1e2f4a4b5c8d6e7f8091a2b3c4" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"employee": {
"description": "Senior technician"
}
}'from exsited import build_client
client = build_client()
response = client.employees.update_employee(
"emp_7b3c9d1e2f4a4b5c8d6e7f8091a2b3c4",
{"employee": {"description": "Senior technician"}},
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.employees.updateEmployee('emp_7b3c9d1e2f4a4b5c8d6e7f8091a2b3c4', {
employee: {description: 'Senior technician'},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->employees->updateEmployee('emp_7b3c9d1e2f4a4b5c8d6e7f8091a2b3c4', [
'employee' => ['description' => 'Senior technician'],
]);
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().updateEmployee(
"emp_7b3c9d1e2f4a4b5c8d6e7f8091a2b3c4",
Map.of("employee", Map.of("description", "Senior technician")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Employees.UpdateEmployeeAsync(
"emp_7b3c9d1e2f4a4b5c8d6e7f8091a2b3c4",
new Dictionary<string, object?>
{
["employee"] = new Dictionary<string, object?>
{
["description"] = "Senior technician",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.employees.updateEmployee(
'emp_7b3c9d1e2f4a4b5c8d6e7f8091a2b3c4',
{
'employee': {'description': 'Senior technician'},
},
);
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().UpdateEmployee(context.Background(), "emp_7b3c9d1e2f4a4b5c8d6e7f8091a2b3c4", map[string]any{
"employee": map[string]any{"description": "Senior technician"},
}, 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 fields to change under
employee, such as description. The updated employee comes back under employee.
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 employee's id, which starts with emp_.
Body
application/json
Show child attributes
Show child attributes
Response
200 - application/json
The updated employee, under employee.
Show child attributes
Show child attributes