Tasks
Save the last task workspace view
Preferences belong to the current staff member and require task-view access. Persistence is unavailable in Support Sessions and returns 409. Last-view persistence strips transient search; an interaction UUID makes retries safe but cannot be reused for a different definition.
PUT
/
admin
/
view-state
/
tasks
Save the last task workspace view
curl --request PUT \
--url https://api.gratona.com/v1/admin/view-state/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": {
"schema_version": 1,
"sort": {
"key": "due_date",
"direction": "asc"
},
"group_by": "due_date",
"include_completed": false,
"filters": {
"assigned_to": "<string>",
"created_by": "<string>",
"related": {
"type": "<string>",
"id": 1
}
},
"search": "<string>"
},
"interaction_id": "b2e01bb7-6c5a-4bc6-9ee6-20b5a4295605",
"source_saved_view_id": 1,
"source_saved_view_lock_version": 1
}
'import requests
url = "https://api.gratona.com/v1/admin/view-state/tasks"
payload = {
"definition": {
"schema_version": 1,
"sort": {
"key": "due_date",
"direction": "asc"
},
"group_by": "due_date",
"include_completed": False,
"filters": {
"assigned_to": "<string>",
"created_by": "<string>",
"related": {
"type": "<string>",
"id": 1
}
},
"search": "<string>"
},
"interaction_id": "b2e01bb7-6c5a-4bc6-9ee6-20b5a4295605",
"source_saved_view_id": 1,
"source_saved_view_lock_version": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
definition: {
schema_version: 1,
sort: {key: 'due_date', direction: 'asc'},
group_by: 'due_date',
include_completed: false,
filters: {
assigned_to: '<string>',
created_by: '<string>',
related: {type: '<string>', id: 1}
},
search: '<string>'
},
interaction_id: 'b2e01bb7-6c5a-4bc6-9ee6-20b5a4295605',
source_saved_view_id: 1,
source_saved_view_lock_version: 1
})
};
fetch('https://api.gratona.com/v1/admin/view-state/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gratona.com/v1/admin/view-state/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'definition' => [
'schema_version' => 1,
'sort' => [
'key' => 'due_date',
'direction' => 'asc'
],
'group_by' => 'due_date',
'include_completed' => false,
'filters' => [
'assigned_to' => '<string>',
'created_by' => '<string>',
'related' => [
'type' => '<string>',
'id' => 1
]
],
'search' => '<string>'
],
'interaction_id' => 'b2e01bb7-6c5a-4bc6-9ee6-20b5a4295605',
'source_saved_view_id' => 1,
'source_saved_view_lock_version' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gratona.com/v1/admin/view-state/tasks"
payload := strings.NewReader("{\n \"definition\": {\n \"schema_version\": 1,\n \"sort\": {\n \"key\": \"due_date\",\n \"direction\": \"asc\"\n },\n \"group_by\": \"due_date\",\n \"include_completed\": false,\n \"filters\": {\n \"assigned_to\": \"<string>\",\n \"created_by\": \"<string>\",\n \"related\": {\n \"type\": \"<string>\",\n \"id\": 1\n }\n },\n \"search\": \"<string>\"\n },\n \"interaction_id\": \"b2e01bb7-6c5a-4bc6-9ee6-20b5a4295605\",\n \"source_saved_view_id\": 1,\n \"source_saved_view_lock_version\": 1\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.gratona.com/v1/admin/view-state/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"definition\": {\n \"schema_version\": 1,\n \"sort\": {\n \"key\": \"due_date\",\n \"direction\": \"asc\"\n },\n \"group_by\": \"due_date\",\n \"include_completed\": false,\n \"filters\": {\n \"assigned_to\": \"<string>\",\n \"created_by\": \"<string>\",\n \"related\": {\n \"type\": \"<string>\",\n \"id\": 1\n }\n },\n \"search\": \"<string>\"\n },\n \"interaction_id\": \"b2e01bb7-6c5a-4bc6-9ee6-20b5a4295605\",\n \"source_saved_view_id\": 1,\n \"source_saved_view_lock_version\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/view-state/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"definition\": {\n \"schema_version\": 1,\n \"sort\": {\n \"key\": \"due_date\",\n \"direction\": \"asc\"\n },\n \"group_by\": \"due_date\",\n \"include_completed\": false,\n \"filters\": {\n \"assigned_to\": \"<string>\",\n \"created_by\": \"<string>\",\n \"related\": {\n \"type\": \"<string>\",\n \"id\": 1\n }\n },\n \"search\": \"<string>\"\n },\n \"interaction_id\": \"b2e01bb7-6c5a-4bc6-9ee6-20b5a4295605\",\n \"source_saved_view_id\": 1,\n \"source_saved_view_lock_version\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"definition": {
"schema_version": 1,
"sort": {
"key": "due_date",
"direction": "asc"
},
"group_by": "due_date",
"include_completed": false,
"filters": {
"assigned_to": "<string>",
"created_by": "<string>",
"related": {
"type": "<string>",
"id": 1
}
},
"search": "<string>"
},
"source_saved_view_id": 123,
"source_saved_view_lock_version": 123,
"lock_version": 123,
"updated_at": "2023-11-07T05:31:56Z",
"warnings": [
"<string>"
]
}
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "<string>",
"error_code": "<string>"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
bearerAuthapiKeyAuth
Passport bearer token authentication for legacy admin sessions.
Body
application/json
Request fields accepted by this operation. Omitted optional properties retain the behavior described above.
Show child attributes
Show child attributes
Validation: required|uuid.
Example:
"b2e01bb7-6c5a-4bc6-9ee6-20b5a4295605"
Validation: nullable|integer|min:1.
Required range:
x >= 1Example:
1
Validation: nullable|integer|min:1.
Required range:
x >= 1Example:
1
Response
Save the last task workspace view response.
Show child attributes
Show child attributes
⌘I
Save the last task workspace view
curl --request PUT \
--url https://api.gratona.com/v1/admin/view-state/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": {
"schema_version": 1,
"sort": {
"key": "due_date",
"direction": "asc"
},
"group_by": "due_date",
"include_completed": false,
"filters": {
"assigned_to": "<string>",
"created_by": "<string>",
"related": {
"type": "<string>",
"id": 1
}
},
"search": "<string>"
},
"interaction_id": "b2e01bb7-6c5a-4bc6-9ee6-20b5a4295605",
"source_saved_view_id": 1,
"source_saved_view_lock_version": 1
}
'import requests
url = "https://api.gratona.com/v1/admin/view-state/tasks"
payload = {
"definition": {
"schema_version": 1,
"sort": {
"key": "due_date",
"direction": "asc"
},
"group_by": "due_date",
"include_completed": False,
"filters": {
"assigned_to": "<string>",
"created_by": "<string>",
"related": {
"type": "<string>",
"id": 1
}
},
"search": "<string>"
},
"interaction_id": "b2e01bb7-6c5a-4bc6-9ee6-20b5a4295605",
"source_saved_view_id": 1,
"source_saved_view_lock_version": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
definition: {
schema_version: 1,
sort: {key: 'due_date', direction: 'asc'},
group_by: 'due_date',
include_completed: false,
filters: {
assigned_to: '<string>',
created_by: '<string>',
related: {type: '<string>', id: 1}
},
search: '<string>'
},
interaction_id: 'b2e01bb7-6c5a-4bc6-9ee6-20b5a4295605',
source_saved_view_id: 1,
source_saved_view_lock_version: 1
})
};
fetch('https://api.gratona.com/v1/admin/view-state/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gratona.com/v1/admin/view-state/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'definition' => [
'schema_version' => 1,
'sort' => [
'key' => 'due_date',
'direction' => 'asc'
],
'group_by' => 'due_date',
'include_completed' => false,
'filters' => [
'assigned_to' => '<string>',
'created_by' => '<string>',
'related' => [
'type' => '<string>',
'id' => 1
]
],
'search' => '<string>'
],
'interaction_id' => 'b2e01bb7-6c5a-4bc6-9ee6-20b5a4295605',
'source_saved_view_id' => 1,
'source_saved_view_lock_version' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gratona.com/v1/admin/view-state/tasks"
payload := strings.NewReader("{\n \"definition\": {\n \"schema_version\": 1,\n \"sort\": {\n \"key\": \"due_date\",\n \"direction\": \"asc\"\n },\n \"group_by\": \"due_date\",\n \"include_completed\": false,\n \"filters\": {\n \"assigned_to\": \"<string>\",\n \"created_by\": \"<string>\",\n \"related\": {\n \"type\": \"<string>\",\n \"id\": 1\n }\n },\n \"search\": \"<string>\"\n },\n \"interaction_id\": \"b2e01bb7-6c5a-4bc6-9ee6-20b5a4295605\",\n \"source_saved_view_id\": 1,\n \"source_saved_view_lock_version\": 1\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.gratona.com/v1/admin/view-state/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"definition\": {\n \"schema_version\": 1,\n \"sort\": {\n \"key\": \"due_date\",\n \"direction\": \"asc\"\n },\n \"group_by\": \"due_date\",\n \"include_completed\": false,\n \"filters\": {\n \"assigned_to\": \"<string>\",\n \"created_by\": \"<string>\",\n \"related\": {\n \"type\": \"<string>\",\n \"id\": 1\n }\n },\n \"search\": \"<string>\"\n },\n \"interaction_id\": \"b2e01bb7-6c5a-4bc6-9ee6-20b5a4295605\",\n \"source_saved_view_id\": 1,\n \"source_saved_view_lock_version\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/view-state/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"definition\": {\n \"schema_version\": 1,\n \"sort\": {\n \"key\": \"due_date\",\n \"direction\": \"asc\"\n },\n \"group_by\": \"due_date\",\n \"include_completed\": false,\n \"filters\": {\n \"assigned_to\": \"<string>\",\n \"created_by\": \"<string>\",\n \"related\": {\n \"type\": \"<string>\",\n \"id\": 1\n }\n },\n \"search\": \"<string>\"\n },\n \"interaction_id\": \"b2e01bb7-6c5a-4bc6-9ee6-20b5a4295605\",\n \"source_saved_view_id\": 1,\n \"source_saved_view_lock_version\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"definition": {
"schema_version": 1,
"sort": {
"key": "due_date",
"direction": "asc"
},
"group_by": "due_date",
"include_completed": false,
"filters": {
"assigned_to": "<string>",
"created_by": "<string>",
"related": {
"type": "<string>",
"id": 1
}
},
"search": "<string>"
},
"source_saved_view_id": 123,
"source_saved_view_lock_version": 123,
"lock_version": 123,
"updated_at": "2023-11-07T05:31:56Z",
"warnings": [
"<string>"
]
}
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "<string>",
"error_code": "<string>"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}