curl --request POST \
--url https://api.protodesk.io/v1/attachments/uploads/{uploadId}/complete \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.protodesk.io/v1/attachments/uploads/{uploadId}/complete"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.protodesk.io/v1/attachments/uploads/{uploadId}/complete', 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://api.protodesk.io/v1/attachments/uploads/{uploadId}/complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.protodesk.io/v1/attachments/uploads/{uploadId}/complete"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.protodesk.io/v1/attachments/uploads/{uploadId}/complete")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.protodesk.io/v1/attachments/uploads/{uploadId}/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"uploadId": "<string>",
"status": "pending",
"url": "<string>",
"method": "PUT",
"headers": {
"Content-Type": "<string>",
"Content-Length": "<string>"
},
"expiresAt": "2023-11-07T05:31:56Z",
"maxSizeBytes": 123,
"attachment": {
"url": "<string>",
"filename": "<string>",
"contentType": "<string>",
"sizeBytes": 123
}
}{
"error": {
"code": "route.not_found",
"message": "Not found",
"requestId": "req_x6q5vl75f5d53m7oet2k4r5w6a"
}
}Complete an upload
Use the same API key or OAuth connection that created this upload. Verifies size, content type, SHA-256 and the existing known-malware policy, then stores immutable validated bytes. Safe to retry with the same uploadId; ready retries do not replace bytes. Returns an attachment object for the attachments array of create_message or send_message. Delivery is a separate action requiring messages:send. A 409 means upload missing or expired; 422 means invalid bytes; 429 means validation is busy (respect Retry-After).
curl --request POST \
--url https://api.protodesk.io/v1/attachments/uploads/{uploadId}/complete \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.protodesk.io/v1/attachments/uploads/{uploadId}/complete"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.protodesk.io/v1/attachments/uploads/{uploadId}/complete', 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://api.protodesk.io/v1/attachments/uploads/{uploadId}/complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.protodesk.io/v1/attachments/uploads/{uploadId}/complete"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.protodesk.io/v1/attachments/uploads/{uploadId}/complete")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.protodesk.io/v1/attachments/uploads/{uploadId}/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"uploadId": "<string>",
"status": "pending",
"url": "<string>",
"method": "PUT",
"headers": {
"Content-Type": "<string>",
"Content-Length": "<string>"
},
"expiresAt": "2023-11-07T05:31:56Z",
"maxSizeBytes": 123,
"attachment": {
"url": "<string>",
"filename": "<string>",
"contentType": "<string>",
"sizeBytes": 123
}
}{
"error": {
"code": "route.not_found",
"message": "Not found",
"requestId": "req_x6q5vl75f5d53m7oet2k4r5w6a"
}
}Authorizations
Use a workspace API key in the Authorization header. Keys use pk_live_<key_id> for production and pk_test<key_id>_ for test mode.
Path Parameters
Response
Ready durable attachment; no message has been sent.
pending, ready Temporary PUT URL, present only while pending.
PUT Show child attributes
Show child attributes
Present only when ready. Use this object in a message's attachments array.
Show child attributes
Show child attributes
