Skip to main content
POST
/
tasks
/
{task_id}
/
attachments
/
source
/
{source_type}
Create task attachment from external source
curl --request POST \
  --url https://api.projectcor.com/v1/tasks/{task_id}/attachments/source/{source_type} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "filename": "<string>",
  "originalname": "<string>",
  "size": 0,
  "available": true,
  "session_token": null
}
'
{
  "id": 123,
  "url": "<string>",
  "name": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "source": "<string>",
  "size": 123,
  "file_type": "<string>",
  "media_type": "<string>",
  "user_id": 123,
  "discussions_id": 123,
  "session_token": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

task_id
integer
required

ID of the task

source_type
enum<string>
required

External file source: GoogleDrive, DropBox, or OneDrive

Available options:
GoogleDrive,
DropBox,
OneDrive

Body

application/json
filename
string
required

URL or path of the file in the external provider

originalname
string
required

Original file name with extension

size
integer
default:0

File size in bytes

available
boolean
default:true

Whether the file is visible

session_token
string | null

Token to group uploads

Response

Attachment created from external source

id
integer
url
string
name
string
created_at
string<date-time>
source
string

Source provider (e.g. GoogleDrive)

size
integer
file_type
string
media_type
string
user_id
integer
discussions_id
integer | null
session_token
string | null