تحميل نسخة مستند خاص
curl --request POST \
--url https://api.truthlocks.com/v1/vault/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'Idempotency-Key: <idempotency-key>' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
options.body = form;
fetch('https://api.truthlocks.com/v1/vault/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/vault/uploads"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/vault/uploads"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"filename": "<string>",
"content_type": "<string>",
"size_bytes": 123,
"sha256": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"purged_at": "2023-11-07T05:31:56Z"
}خزينة مستندات مساحة العمل
تحميل نسخة مستند خاص
يتطلب جلسة حامل عضو مساحة عمل مسجل الدخول. مفاتيح API غير مقبولة. تأتي مساحة العمل والبيئة من الجلسة المعتمدة. تتطلب التغييرات مالك مساحة العمل أو المسؤول.
POST
/
v1
/
vault
/
uploads
تحميل نسخة مستند خاص
curl --request POST \
--url https://api.truthlocks.com/v1/vault/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'Idempotency-Key: <idempotency-key>' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
options.body = form;
fetch('https://api.truthlocks.com/v1/vault/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/vault/uploads"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/vault/uploads"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"filename": "<string>",
"content_type": "<string>",
"size_bytes": 123,
"sha256": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"purged_at": "2023-11-07T05:31:56Z"
}استخدم جلسة حامل مساحة عمل صالحة. لا يمكن لمفتاح واجهة برمجة التطبيقات تخويل نقطة النهاية هذه. يتم اشتقاق مساحة العمل والبيئة الحالية من تلك الجلسة.
راجع معالجة المعلومات لقيود الملفات، وإدارة الإصدارات، والاحتجاز، والاحتفاظ، وسلوك التخلص.
الترويسات
الجسم
multipart/form-data

