Create a task
curl --request POST \
--url https://tasksocial-production.up.railway.app/api/v1/tasks/create \
--header 'Content-Type: application/json' \
--cookie tokenName= \
--data '
{
"title": "Finish API documentation",
"description": "Document the TaskSocial API"
}
'import requests
url = "https://tasksocial-production.up.railway.app/api/v1/tasks/create"
payload = {
"title": "Finish API documentation",
"description": "Document the TaskSocial API"
}
headers = {
"cookie": "tokenName=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'tokenName=', 'Content-Type': 'application/json'},
body: JSON.stringify({title: 'Finish API documentation', description: 'Document the TaskSocial API'})
};
fetch('https://tasksocial-production.up.railway.app/api/v1/tasks/create', 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/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Finish API documentation',
'description' => 'Document the TaskSocial API'
]),
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/create"
payload := strings.NewReader("{\n \"title\": \"Finish API documentation\",\n \"description\": \"Document the TaskSocial API\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://tasksocial-production.up.railway.app/api/v1/tasks/create")
.header("cookie", "tokenName=")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Finish API documentation\",\n \"description\": \"Document the TaskSocial API\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tasksocial-production.up.railway.app/api/v1/tasks/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'tokenName='
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Finish API documentation\",\n \"description\": \"Document the TaskSocial API\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"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>"
}Tasks
Create a task
Creates a task for the authenticated user.
POST
/
api
/
v1
/
tasks
/
create
Create a task
curl --request POST \
--url https://tasksocial-production.up.railway.app/api/v1/tasks/create \
--header 'Content-Type: application/json' \
--cookie tokenName= \
--data '
{
"title": "Finish API documentation",
"description": "Document the TaskSocial API"
}
'import requests
url = "https://tasksocial-production.up.railway.app/api/v1/tasks/create"
payload = {
"title": "Finish API documentation",
"description": "Document the TaskSocial API"
}
headers = {
"cookie": "tokenName=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'tokenName=', 'Content-Type': 'application/json'},
body: JSON.stringify({title: 'Finish API documentation', description: 'Document the TaskSocial API'})
};
fetch('https://tasksocial-production.up.railway.app/api/v1/tasks/create', 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/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Finish API documentation',
'description' => 'Document the TaskSocial API'
]),
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/create"
payload := strings.NewReader("{\n \"title\": \"Finish API documentation\",\n \"description\": \"Document the TaskSocial API\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://tasksocial-production.up.railway.app/api/v1/tasks/create")
.header("cookie", "tokenName=")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Finish API documentation\",\n \"description\": \"Document the TaskSocial API\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tasksocial-production.up.railway.app/api/v1/tasks/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'tokenName='
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Finish API documentation\",\n \"description\": \"Document the TaskSocial API\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"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>"
}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.