cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/tasks" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"work_task": {
"name": "Repair fence"
}
}'from exsited import build_client
client = build_client()
response = client.tasks.create_task({"work_task": {"name": "Repair fence"}})
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.tasks.createTask({work_task: {name: 'Repair fence'}});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->tasks->createTask(['work_task' => ['name' => 'Repair fence']]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.tasks.tasks_dto.TasksDto.TaskView;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<TaskView> response = client.tasks().createTask(
Map.of("work_task", Map.of("name", "Repair fence")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Tasks.CreateTaskAsync(new Dictionary<string, object?>
{
["work_task"] = new Dictionary<string, object?>
{
["name"] = "Repair fence",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.tasks.createTask({
'work_task': {'name': 'Repair fence'},
});
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.Tasks().CreateTask(context.Background(), map[string]any{
"work_task": map[string]any{"name": "Repair fence"},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"work_task": {
"activity_logs": [
{
"activity": "<string>"
}
],
"actual_hours": null,
"alerts": "<array>",
"assignees": {
"manually_added_account_contacts": "<array>",
"selected_account_contacts": "<array>",
"selected_employees": [
{
"display_order": 123,
"email": "<string>",
"employee_code": "<string>",
"name": "<string>",
"responsibility": null,
"uuid": "<string>"
}
],
"selected_labours": [
{
"display_order": 123,
"email": "<string>",
"labour_code": "<string>",
"name": "<string>",
"responsibility": null,
"uuid": "<string>"
}
],
"selected_operators": "<array>"
},
"checklist": "<array>",
"code": "<string>",
"completed_at": "<string>",
"completed_by": {
"name": "<string>",
"object": "<string>"
},
"created_by": {
"name": "<string>",
"object": "<string>"
},
"created_on": "<string>",
"custom_attributes": "<array>",
"description": "<string>",
"display_name": "<string>",
"due_date": "<string>",
"estimated_hours": 123,
"href": "<string>",
"id": "<string>",
"last_updated_by": {
"name": "<string>",
"object": "<string>"
},
"last_updated_on": "<string>",
"milestone": null,
"name": "<string>",
"object": "<string>",
"parent_task": null,
"priority": "<string>",
"resource": null,
"sort_order": 123,
"start_after": null,
"start_date": "<string>",
"state": null,
"status": "<string>",
"task_status": "<string>",
"version": 123,
"workflow": null
}
}Tasks
Create a task
Creates a task and returns it under work_task.
POST
/
tasks
cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/tasks" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"work_task": {
"name": "Repair fence"
}
}'from exsited import build_client
client = build_client()
response = client.tasks.create_task({"work_task": {"name": "Repair fence"}})
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.tasks.createTask({work_task: {name: 'Repair fence'}});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->tasks->createTask(['work_task' => ['name' => 'Repair fence']]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.tasks.tasks_dto.TasksDto.TaskView;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<TaskView> response = client.tasks().createTask(
Map.of("work_task", Map.of("name", "Repair fence")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Tasks.CreateTaskAsync(new Dictionary<string, object?>
{
["work_task"] = new Dictionary<string, object?>
{
["name"] = "Repair fence",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.tasks.createTask({
'work_task': {'name': 'Repair fence'},
});
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.Tasks().CreateTask(context.Background(), map[string]any{
"work_task": map[string]any{"name": "Repair fence"},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"work_task": {
"activity_logs": [
{
"activity": "<string>"
}
],
"actual_hours": null,
"alerts": "<array>",
"assignees": {
"manually_added_account_contacts": "<array>",
"selected_account_contacts": "<array>",
"selected_employees": [
{
"display_order": 123,
"email": "<string>",
"employee_code": "<string>",
"name": "<string>",
"responsibility": null,
"uuid": "<string>"
}
],
"selected_labours": [
{
"display_order": 123,
"email": "<string>",
"labour_code": "<string>",
"name": "<string>",
"responsibility": null,
"uuid": "<string>"
}
],
"selected_operators": "<array>"
},
"checklist": "<array>",
"code": "<string>",
"completed_at": "<string>",
"completed_by": {
"name": "<string>",
"object": "<string>"
},
"created_by": {
"name": "<string>",
"object": "<string>"
},
"created_on": "<string>",
"custom_attributes": "<array>",
"description": "<string>",
"display_name": "<string>",
"due_date": "<string>",
"estimated_hours": 123,
"href": "<string>",
"id": "<string>",
"last_updated_by": {
"name": "<string>",
"object": "<string>"
},
"last_updated_on": "<string>",
"milestone": null,
"name": "<string>",
"object": "<string>",
"parent_task": null,
"priority": "<string>",
"resource": null,
"sort_order": 123,
"start_after": null,
"start_date": "<string>",
"state": null,
"status": "<string>",
"task_status": "<string>",
"version": 123,
"workflow": null
}
}Send the new task under
work_task. name is required, and a key the API does not know is refused. The new task comes back with 201 under work_task, in the same form as retrieving it.
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.