Update a Task
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");curl_easy_setopt(hnd, CURLOPT_URL, "https://your-instance.seventhings.com/customer-api/v1/task-management/task/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0");
struct curl_slist *headers = NULL;headers = curl_slist_append(headers, "Authorization: Bearer <token>");headers = curl_slist_append(headers, "Content-Type: application/json");curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{ \"title\": \"Refill the printer.\", \"comment\": \"The printer is running low on ink.\", \"deadline\": \"2022-04-01\", \"reminders\": [ { \"unit\": \"days\", \"value\": 2 } ], \"recurring_schedule\": { \"unit\": \"days\", \"value\": 2 }, \"assignees\": [ \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\" ], \"references\": [ { \"type\": \"asset\", \"uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\", \"status\": \"open\" } ], \"attachments\": [ \"7d8296ad-da7c-45f7-b676-9220b3a9d4dc\" ], \"notify\": true }");
CURLcode ret = curl_easy_perform(hnd);using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Put, RequestUri = new Uri("https://your-instance.seventhings.com/customer-api/v1/task-management/task/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"), Headers = { { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"title\": \"Refill the printer.\", \"comment\": \"The printer is running low on ink.\", \"deadline\": \"2022-04-01\", \"reminders\": [ { \"unit\": \"days\", \"value\": 2 } ], \"recurring_schedule\": { \"unit\": \"days\", \"value\": 2 }, \"assignees\": [ \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\" ], \"references\": [ { \"type\": \"asset\", \"uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\", \"status\": \"open\" } ], \"attachments\": [ \"7d8296ad-da7c-45f7-b676-9220b3a9d4dc\" ], \"notify\": true }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://your-instance.seventhings.com/customer-api/v1/task-management/task/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
payload := strings.NewReader("{ \"title\": \"Refill the printer.\", \"comment\": \"The printer is running low on ink.\", \"deadline\": \"2022-04-01\", \"reminders\": [ { \"unit\": \"days\", \"value\": 2 } ], \"recurring_schedule\": { \"unit\": \"days\", \"value\": 2 }, \"assignees\": [ \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\" ], \"references\": [ { \"type\": \"asset\", \"uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\", \"status\": \"open\" } ], \"attachments\": [ \"7d8296ad-da7c-45f7-b676-9220b3a9d4dc\" ], \"notify\": true }")
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(res) fmt.Println(string(body))
}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://your-instance.seventhings.com/customer-api/v1/task-management/task/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0")) .header("Authorization", "Bearer <token>") .header("Content-Type", "application/json") .method("PUT", HttpRequest.BodyPublishers.ofString("{ \"title\": \"Refill the printer.\", \"comment\": \"The printer is running low on ink.\", \"deadline\": \"2022-04-01\", \"reminders\": [ { \"unit\": \"days\", \"value\": 2 } ], \"recurring_schedule\": { \"unit\": \"days\", \"value\": 2 }, \"assignees\": [ \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\" ], \"references\": [ { \"type\": \"asset\", \"uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\", \"status\": \"open\" } ], \"attachments\": [ \"7d8296ad-da7c-45f7-b676-9220b3a9d4dc\" ], \"notify\": true }")) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");RequestBody body = RequestBody.create(mediaType, "{ \"title\": \"Refill the printer.\", \"comment\": \"The printer is running low on ink.\", \"deadline\": \"2022-04-01\", \"reminders\": [ { \"unit\": \"days\", \"value\": 2 } ], \"recurring_schedule\": { \"unit\": \"days\", \"value\": 2 }, \"assignees\": [ \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\" ], \"references\": [ { \"type\": \"asset\", \"uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\", \"status\": \"open\" } ], \"attachments\": [ \"7d8296ad-da7c-45f7-b676-9220b3a9d4dc\" ], \"notify\": true }");Request request = new Request.Builder() .url("https://your-instance.seventhings.com/customer-api/v1/task-management/task/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0") .put(body) .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'PUT', url: 'https://your-instance.seventhings.com/customer-api/v1/task-management/task/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, data: { title: 'Refill the printer.', comment: 'The printer is running low on ink.', deadline: '2022-04-01', reminders: [{unit: 'days', value: 2}], recurring_schedule: {unit: 'days', value: 2}, assignees: ['a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'], references: [{type: 'asset', uuid: 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', status: 'open'}], attachments: ['7d8296ad-da7c-45f7-b676-9220b3a9d4dc'], notify: true }};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://your-instance.seventhings.com/customer-api/v1/task-management/task/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"title":"Refill the printer.","comment":"The printer is running low on ink.","deadline":"2022-04-01","reminders":[{"unit":"days","value":2}],"recurring_schedule":{"unit":"days","value":2},"assignees":["a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"],"references":[{"type":"asset","uuid":"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11","status":"open"}],"attachments":["7d8296ad-da7c-45f7-b676-9220b3a9d4dc"],"notify":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")val body = RequestBody.create(mediaType, "{ \"title\": \"Refill the printer.\", \"comment\": \"The printer is running low on ink.\", \"deadline\": \"2022-04-01\", \"reminders\": [ { \"unit\": \"days\", \"value\": 2 } ], \"recurring_schedule\": { \"unit\": \"days\", \"value\": 2 }, \"assignees\": [ \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\" ], \"references\": [ { \"type\": \"asset\", \"uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\", \"status\": \"open\" } ], \"attachments\": [ \"7d8296ad-da7c-45f7-b676-9220b3a9d4dc\" ], \"notify\": true }")val request = Request.Builder() .url("https://your-instance.seventhings.com/customer-api/v1/task-management/task/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0") .put(body) .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build()
val response = client.newCall(request).execute()<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://your-instance.seventhings.com/customer-api/v1/task-management/task/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", 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([ 'title' => 'Refill the printer.', 'comment' => 'The printer is running low on ink.', 'deadline' => '2022-04-01', 'reminders' => [ [ 'unit' => 'days', 'value' => 2 ] ], 'recurring_schedule' => [ 'unit' => 'days', 'value' => 2 ], 'assignees' => [ 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11' ], 'references' => [ [ 'type' => 'asset', 'uuid' => 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', 'status' => 'open' ] ], 'attachments' => [ '7d8296ad-da7c-45f7-b676-9220b3a9d4dc' ], 'notify' => null ]), 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;}<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PUT', 'https://your-instance.seventhings.com/customer-api/v1/task-management/task/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0', [ 'body' => '{ "title": "Refill the printer.", "comment": "The printer is running low on ink.", "deadline": "2022-04-01", "reminders": [ { "unit": "days", "value": 2 } ], "recurring_schedule": { "unit": "days", "value": 2 }, "assignees": [ "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" ], "references": [ { "type": "asset", "uuid": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", "status": "open" } ], "attachments": [ "7d8296ad-da7c-45f7-b676-9220b3a9d4dc" ], "notify": true }', 'headers' => [ 'Authorization' => 'Bearer <token>', 'Content-Type' => 'application/json', ],]);
echo $response->getBody();import http.client
conn = http.client.HTTPSConnection("your-instance.seventhings.com")
payload = "{ \"title\": \"Refill the printer.\", \"comment\": \"The printer is running low on ink.\", \"deadline\": \"2022-04-01\", \"reminders\": [ { \"unit\": \"days\", \"value\": 2 } ], \"recurring_schedule\": { \"unit\": \"days\", \"value\": 2 }, \"assignees\": [ \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\" ], \"references\": [ { \"type\": \"asset\", \"uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\", \"status\": \"open\" } ], \"attachments\": [ \"7d8296ad-da7c-45f7-b676-9220b3a9d4dc\" ], \"notify\": true }"
headers = { 'Authorization': "Bearer <token>", 'Content-Type': "application/json"}
conn.request("PUT", "/customer-api/v1/task-management/task/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", payload, headers)
res = conn.getresponse()data = res.read()
print(data.decode("utf-8"))import requests
url = "https://your-instance.seventhings.com/customer-api/v1/task-management/task/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
payload = { "title": "Refill the printer.", "comment": "The printer is running low on ink.", "deadline": "2022-04-01", "reminders": [ { "unit": "days", "value": 2 } ], "recurring_schedule": { "unit": "days", "value": 2 }, "assignees": ["a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"], "references": [ { "type": "asset", "uuid": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", "status": "open" } ], "attachments": ["7d8296ad-da7c-45f7-b676-9220b3a9d4dc"], "notify": True}headers = { "Authorization": "Bearer <token>", "Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())use std::str::FromStr;use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://your-instance.seventhings.com/customer-api/v1/task-management/task/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0";
let payload = json!({ "title": "Refill the printer.", "comment": "The printer is running low on ink.", "deadline": "2022-04-01", "reminders": ( json!({ "unit": "days", "value": 2 }) ), "recurring_schedule": json!({ "unit": "days", "value": 2 }), "assignees": ("a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"), "references": ( json!({ "type": "asset", "uuid": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", "status": "open" }) ), "attachments": ("7d8296ad-da7c-45f7-b676-9220b3a9d4dc"), "notify": true });
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request PUT \ --url https://your-instance.seventhings.com/customer-api/v1/task-management/task/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "title": "Refill the printer.", "comment": "The printer is running low on ink.", "deadline": "2022-04-01", "reminders": [ { "unit": "days", "value": 2 } ], "recurring_schedule": { "unit": "days", "value": 2 }, "assignees": [ "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" ], "references": [ { "type": "asset", "uuid": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", "status": "open" } ], "attachments": [ "7d8296ad-da7c-45f7-b676-9220b3a9d4dc" ], "notify": true }'wget --quiet \ --method PUT \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --body-data '{ "title": "Refill the printer.", "comment": "The printer is running low on ink.", "deadline": "2022-04-01", "reminders": [ { "unit": "days", "value": 2 } ], "recurring_schedule": { "unit": "days", "value": 2 }, "assignees": [ "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" ], "references": [ { "type": "asset", "uuid": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", "status": "open" } ], "attachments": [ "7d8296ad-da7c-45f7-b676-9220b3a9d4dc" ], "notify": true }' \ --output-document \ - https://your-instance.seventhings.com/customer-api/v1/task-management/task/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0Update a Task.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Task to be updated
The payload for creating a new task.
object
The UUID of the task.
Example
a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11The title of the task.
Example
Refill the printer.A comment that is displayed in the task details.
Example
The printer is running low on ink.The date and time of the deadline.
Example
2022-04-01A time interval that is used to trigger a task.
object
The unit of the time interval.
Example
weeksThe value of the time interval.
Example
2object
The unit of the time interval.
Example
weeksThe value of the time interval.
Example
2The reference of the task.
object
The type of the referenced object.
Example
assetThe UUID of the referenced object.
Example
a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11Display name of the referenced object.
Example
Assset name (asset barcode)The id of the referenced object.
Example
1The status of the referenced object.
Example
openResponses
Section titled “Responses”The Task was updated successfully.
Access token is missing or invalid.
You are not permitted to perform the requested operation.
The requested resource could not be found.
Internal Server Error.

