Update a task
curl --request PUT \
--url https://tasksocial-production.up.railway.app/api/v1/tasks/{id} \
--header 'Content-Type: application/json' \
--cookie tokenName= \
--data '
{
"title": "Finish API documentation",
"description": "Document and validate the API",
"status": "completed"
}
'import requests
url = "https://tasksocial-production.up.railway.app/api/v1/tasks/{id}"
payload = {
"title": "Finish API documentation",
"description": "Document and validate the API",
"status": "completed"
}
headers = {
"cookie": "tokenName=",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {cookie: 'tokenName=', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Finish API documentation',
description: 'Document and validate the API',
status: 'completed'
})
};
fetch('https://tasksocial-production.up.railway.app/api/v1/tasks/{id}', 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://tasksocial-production.up.railway.app/api/v1/tasks/{id}",
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' => 'Finish API documentation',
'description' => 'Document and validate the API',
'status' => 'completed'
]),
CURLOPT_COOKIE => "tokenName=",
CURLOPT_HTTPHEADER => [
"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://tasksocial-production.up.railway.app/api/v1/tasks/{id}"
payload := strings.NewReader("{\n \"title\": \"Finish API documentation\",\n \"description\": \"Document and validate the API\",\n \"status\": \"completed\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("cookie", "tokenName=")
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://tasksocial-production.up.railway.app/api/v1/tasks/{id}")
.header("cookie", "tokenName=")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Finish API documentation\",\n \"description\": \"Document and validate the API\",\n \"status\": \"completed\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tasksocial-production.up.railway.app/api/v1/tasks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["cookie"] = 'tokenName='
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Finish API documentation\",\n \"description\": \"Document and validate the API\",\n \"status\": \"completed\"\n}"
response = http.request(request)
puts response.read_body{
"task": {
"title": "<string>",
"description": "<string>",
"author": "<string>",
"status": "pending",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Tasks
Update a task
Updates a task owned by the authenticated user.
PUT
/
api
/
v1
/
tasks
/
{id}
Update a task
curl --request PUT \
--url https://tasksocial-production.up.railway.app/api/v1/tasks/{id} \
--header 'Content-Type: application/json' \
--cookie tokenName= \
--data '
{
"title": "Finish API documentation",
"description": "Document and validate the API",
"status": "completed"
}
'import requests
url = "https://tasksocial-production.up.railway.app/api/v1/tasks/{id}"
payload = {
"title": "Finish API documentation",
"description": "Document and validate the API",
"status": "completed"
}
headers = {
"cookie": "tokenName=",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {cookie: 'tokenName=', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Finish API documentation',
description: 'Document and validate the API',
status: 'completed'
})
};
fetch('https://tasksocial-production.up.railway.app/api/v1/tasks/{id}', 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://tasksocial-production.up.railway.app/api/v1/tasks/{id}",
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' => 'Finish API documentation',
'description' => 'Document and validate the API',
'status' => 'completed'
]),
CURLOPT_COOKIE => "tokenName=",
CURLOPT_HTTPHEADER => [
"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://tasksocial-production.up.railway.app/api/v1/tasks/{id}"
payload := strings.NewReader("{\n \"title\": \"Finish API documentation\",\n \"description\": \"Document and validate the API\",\n \"status\": \"completed\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("cookie", "tokenName=")
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://tasksocial-production.up.railway.app/api/v1/tasks/{id}")
.header("cookie", "tokenName=")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Finish API documentation\",\n \"description\": \"Document and validate the API\",\n \"status\": \"completed\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tasksocial-production.up.railway.app/api/v1/tasks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["cookie"] = 'tokenName='
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Finish API documentation\",\n \"description\": \"Document and validate the API\",\n \"status\": \"completed\"\n}"
response = http.request(request)
puts response.read_body{
"task": {
"title": "<string>",
"description": "<string>",
"author": "<string>",
"status": "pending",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
JWT authentication cookie. The server sets this cookie after a successful login. You do not need to generate or provide an API key manually. Use the login endpoint first, then the browser or HTTP client sends this cookie with protected requests.
Path Parameters
MongoDB ObjectId of the task.
Body
application/json
Response
Task updated successfully.
Show child attributes
Show child attributes