Delete task attachments
curl --request DELETE \
--url https://api.projectcor.com/v1/tasks/{task_id}/attachments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attachments": [
123
],
"lastPage": 123,
"order": {
"created_at": "DESC"
}
}
'import requests
url = "https://api.projectcor.com/v1/tasks/{task_id}/attachments"
payload = {
"attachments": [123],
"lastPage": 123,
"order": { "created_at": "DESC" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({attachments: [123], lastPage: 123, order: {created_at: 'DESC'}})
};
fetch('https://api.projectcor.com/v1/tasks/{task_id}/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.projectcor.com/v1/tasks/{task_id}/attachments';
const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({attachments: [123], lastPage: 123, order: {created_at: 'DESC'}})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.projectcor.com/v1/tasks/{task_id}/attachments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'attachments' => [
123
],
'lastPage' => 123,
'order' => [
'created_at' => 'DESC'
]
]),
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.projectcor.com/v1/tasks/{task_id}/attachments"
payload := strings.NewReader("{\n \"attachments\": [\n 123\n ],\n \"lastPage\": 123,\n \"order\": {\n \"created_at\": \"DESC\"\n }\n}")
req, _ := http.NewRequest("DELETE", 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))
}{
"deleted": true,
"elements": [
{
"id": 123,
"url": "<string>",
"size": 123,
"source": "<string>",
"user_id": 123,
"available": true,
"file_type": "<string>",
"media_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"originalname": "<string>",
"discussions_id": 123,
"parent_type": "<string>",
"name": "<string>",
"parent_id": 123,
"attachment_parent_id": 123,
"version": 123,
"currentVersionData": {},
"currentVersionId": 123,
"currentVersion": 123,
"user": {
"id": 123,
"first_name": "<string>",
"last_name": "<string>",
"picture": "<string>"
},
"graphicsCount": "<string>",
"taskLogReworksId": 123,
"createdFrom": "<string>"
}
]
}{
"status": "ERROR",
"code": "FS003",
"message": "Undefined attachment"
}{
"status": 417,
"name": "CORCustomError",
"code": "AC001",
"message": "exists validation failed on taskId"
}Task Attachments
Delete task attachments
Deletes one or more attachments from a task.
DELETE
/
tasks
/
{task_id}
/
attachments
Delete task attachments
curl --request DELETE \
--url https://api.projectcor.com/v1/tasks/{task_id}/attachments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attachments": [
123
],
"lastPage": 123,
"order": {
"created_at": "DESC"
}
}
'import requests
url = "https://api.projectcor.com/v1/tasks/{task_id}/attachments"
payload = {
"attachments": [123],
"lastPage": 123,
"order": { "created_at": "DESC" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({attachments: [123], lastPage: 123, order: {created_at: 'DESC'}})
};
fetch('https://api.projectcor.com/v1/tasks/{task_id}/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.projectcor.com/v1/tasks/{task_id}/attachments';
const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({attachments: [123], lastPage: 123, order: {created_at: 'DESC'}})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.projectcor.com/v1/tasks/{task_id}/attachments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'attachments' => [
123
],
'lastPage' => 123,
'order' => [
'created_at' => 'DESC'
]
]),
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.projectcor.com/v1/tasks/{task_id}/attachments"
payload := strings.NewReader("{\n \"attachments\": [\n 123\n ],\n \"lastPage\": 123,\n \"order\": {\n \"created_at\": \"DESC\"\n }\n}")
req, _ := http.NewRequest("DELETE", 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))
}{
"deleted": true,
"elements": [
{
"id": 123,
"url": "<string>",
"size": 123,
"source": "<string>",
"user_id": 123,
"available": true,
"file_type": "<string>",
"media_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"originalname": "<string>",
"discussions_id": 123,
"parent_type": "<string>",
"name": "<string>",
"parent_id": 123,
"attachment_parent_id": 123,
"version": 123,
"currentVersionData": {},
"currentVersionId": 123,
"currentVersion": 123,
"user": {
"id": 123,
"first_name": "<string>",
"last_name": "<string>",
"picture": "<string>"
},
"graphicsCount": "<string>",
"taskLogReworksId": 123,
"createdFrom": "<string>"
}
]
}{
"status": "ERROR",
"code": "FS003",
"message": "Undefined attachment"
}{
"status": 417,
"name": "CORCustomError",
"code": "AC001",
"message": "exists validation failed on taskId"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the task
Body
application/json
Was this page helpful?
⌘I

