cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/labours" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"labour": {
"name": "Jane Citizen",
"display_name": "Jane Citizen",
"email_address": "jane@example.com",
"labour_profile": "Standard technician"
}
}'from exsited import build_client
client = build_client()
response = client.labours.create_labour(
{
"labour": {
"name": "Jane Citizen",
"display_name": "Jane Citizen",
"email_address": "jane@example.com",
"labour_profile": "Standard technician",
}
}
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.labours.createLabour({
labour: {
name: 'Jane Citizen',
display_name: 'Jane Citizen',
email_address: 'jane@example.com',
labour_profile: 'Standard technician',
},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->labours->createLabour([
'labour' => [
'name' => 'Jane Citizen',
'display_name' => 'Jane Citizen',
'email_address' => 'jane@example.com',
'labour_profile' => 'Standard technician',
],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.labours.labours_dto.LaboursDto.Labour;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<Labour> response = client.labours().createLabour(
Map.of(
"labour", Map.of(
"name", "Jane Citizen",
"display_name", "Jane Citizen",
"email_address", "jane@example.com",
"labour_profile", "Standard technician")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Labours.CreateLabourAsync(new Dictionary<string, object?>
{
["labour"] = new Dictionary<string, object?>
{
["name"] = "Jane Citizen",
["display_name"] = "Jane Citizen",
["email_address"] = "jane@example.com",
["labour_profile"] = "Standard technician",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.labours.createLabour({
'labour': {
'name': 'Jane Citizen',
'display_name': 'Jane Citizen',
'email_address': 'jane@example.com',
'labour_profile': 'Standard 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.Labours().CreateLabour(context.Background(), map[string]any{
"labour": map[string]any{
"name": "Jane Citizen",
"display_name": "Jane Citizen",
"email_address": "jane@example.com",
"labour_profile": "Standard technician",
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"labour": {
"activity_logs": "<array>",
"code": "<string>",
"created_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"created_on": "<string>",
"custom_form": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"description": "<string>",
"display_name": "<string>",
"email_address": "<string>",
"href": "<string>",
"id": "<string>",
"image_name": null,
"labour_availability": "<array>",
"labour_contacts": [
{
"address_line_1": "<string>",
"address_line_2": "<string>",
"address_line_3": "<string>",
"address_line_4": "<string>",
"address_line_5": "<string>",
"city": "<string>",
"contact_type": "<string>",
"country": "<string>",
"designation": "<string>",
"email_address": "<string>",
"fax": {
"area_code": "<string>",
"country_code": "<string>",
"do_not_call": true,
"full": "<string>",
"number": "<string>"
},
"first_name": "<string>",
"id": "<string>",
"last_name": "<string>",
"middle_name": null,
"mobile": {
"area_code": "<string>",
"country_code": "<string>",
"do_not_call": true,
"full": "<string>",
"number": "<string>"
},
"object": "<string>",
"phone": {
"area_code": "<string>",
"country_code": "<string>",
"do_not_call": true,
"full": "<string>",
"number": "<string>"
},
"post_code": "<string>",
"receive_email": true,
"salutation": "<string>",
"state": "<string>",
"status": "<string>"
}
],
"labour_custom_availability": [
{
"available": true,
"end_time": "<string>",
"id": "<string>",
"object": "<string>",
"preferred_day": "<string>",
"start_time": "<string>"
}
],
"labour_profile": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"last_updated_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"last_updated_on": "<string>",
"name": "<string>",
"object": "<string>",
"status": "<string>",
"use_custom_availability": true,
"version": 123
}
}Labours
Create a labour
Creates a labour on a labour profile and returns it under labour.
POST
/
labours
cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/labours" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"labour": {
"name": "Jane Citizen",
"display_name": "Jane Citizen",
"email_address": "jane@example.com",
"labour_profile": "Standard technician"
}
}'from exsited import build_client
client = build_client()
response = client.labours.create_labour(
{
"labour": {
"name": "Jane Citizen",
"display_name": "Jane Citizen",
"email_address": "jane@example.com",
"labour_profile": "Standard technician",
}
}
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.labours.createLabour({
labour: {
name: 'Jane Citizen',
display_name: 'Jane Citizen',
email_address: 'jane@example.com',
labour_profile: 'Standard technician',
},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->labours->createLabour([
'labour' => [
'name' => 'Jane Citizen',
'display_name' => 'Jane Citizen',
'email_address' => 'jane@example.com',
'labour_profile' => 'Standard technician',
],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.labours.labours_dto.LaboursDto.Labour;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<Labour> response = client.labours().createLabour(
Map.of(
"labour", Map.of(
"name", "Jane Citizen",
"display_name", "Jane Citizen",
"email_address", "jane@example.com",
"labour_profile", "Standard technician")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Labours.CreateLabourAsync(new Dictionary<string, object?>
{
["labour"] = new Dictionary<string, object?>
{
["name"] = "Jane Citizen",
["display_name"] = "Jane Citizen",
["email_address"] = "jane@example.com",
["labour_profile"] = "Standard technician",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.labours.createLabour({
'labour': {
'name': 'Jane Citizen',
'display_name': 'Jane Citizen',
'email_address': 'jane@example.com',
'labour_profile': 'Standard 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.Labours().CreateLabour(context.Background(), map[string]any{
"labour": map[string]any{
"name": "Jane Citizen",
"display_name": "Jane Citizen",
"email_address": "jane@example.com",
"labour_profile": "Standard technician",
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"labour": {
"activity_logs": "<array>",
"code": "<string>",
"created_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"created_on": "<string>",
"custom_form": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"description": "<string>",
"display_name": "<string>",
"email_address": "<string>",
"href": "<string>",
"id": "<string>",
"image_name": null,
"labour_availability": "<array>",
"labour_contacts": [
{
"address_line_1": "<string>",
"address_line_2": "<string>",
"address_line_3": "<string>",
"address_line_4": "<string>",
"address_line_5": "<string>",
"city": "<string>",
"contact_type": "<string>",
"country": "<string>",
"designation": "<string>",
"email_address": "<string>",
"fax": {
"area_code": "<string>",
"country_code": "<string>",
"do_not_call": true,
"full": "<string>",
"number": "<string>"
},
"first_name": "<string>",
"id": "<string>",
"last_name": "<string>",
"middle_name": null,
"mobile": {
"area_code": "<string>",
"country_code": "<string>",
"do_not_call": true,
"full": "<string>",
"number": "<string>"
},
"object": "<string>",
"phone": {
"area_code": "<string>",
"country_code": "<string>",
"do_not_call": true,
"full": "<string>",
"number": "<string>"
},
"post_code": "<string>",
"receive_email": true,
"salutation": "<string>",
"state": "<string>",
"status": "<string>"
}
],
"labour_custom_availability": [
{
"available": true,
"end_time": "<string>",
"id": "<string>",
"object": "<string>",
"preferred_day": "<string>",
"start_time": "<string>"
}
],
"labour_profile": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"last_updated_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"last_updated_on": "<string>",
"name": "<string>",
"object": "<string>",
"status": "<string>",
"use_custom_availability": true,
"version": 123
}
}Send the new labour under
labour with its name, display_name, email_address and the name of its labour_profile. The new labour comes back under labour, with its id and 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.