Upload a document
AuthorizationBearer <token>
In: header
Query Parameters
projectIdstring
Format
"uuid"documentTypeIdstring
Format
"uuid"title?string
description?string
tags?string
Comma-separated tags
file?file
Format
"binary"Response Body
curl -X POST "http://localhost:3000/api/documents/upload?projectId=497f6eca-6276-4993-bfeb-53cbbbba6f08&documentTypeId=497f6eca-6276-4993-bfeb-53cbbbba6f08&title=string&description=string&tags=string"const body = new FormData();
fetch("http://localhost:3000/api/documents/upload?projectId=497f6eca-6276-4993-bfeb-53cbbbba6f08&documentTypeId=497f6eca-6276-4993-bfeb-53cbbbba6f08&title=string&description=string&tags=string", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"mime/multipart"
"bytes"
)
func main() {
url := "http://localhost:3000/api/documents/upload?projectId=497f6eca-6276-4993-bfeb-53cbbbba6f08&documentTypeId=497f6eca-6276-4993-bfeb-53cbbbba6f08&title=string&description=string&tags=string"
body := new(bytes.Buffer)
mp := multipart.NewWriter(payload)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "multipart/form-data")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "http://localhost:3000/api/documents/upload?projectId=497f6eca-6276-4993-bfeb-53cbbbba6f08&documentTypeId=497f6eca-6276-4993-bfeb-53cbbbba6f08&title=string&description=string&tags=string"
body = {}
response = requests.request("POST", url, data = body, headers = {
"Content-Type": "multipart/form-data"
})
print(response.text){
"message": "string",
"document": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"projectId": "5a8591dd-4039-49df-9202-96385ba3eff8",
"documentTypeId": "50553e40-12c2-4419-b582-c37b1f8e3bec",
"title": "string",
"description": "string",
"fileName": "string",
"fileSize": 0,
"mimeType": "string",
"currentVersion": 0,
"status": "draft",
"tags": [
"string"
],
"metadata": {},
"uploadedBy": "1e2815fd-75c7-4289-86d5-2503daeb59b8",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
}