Upload a file part
curl --request PUT \
--url https://app.gc.ai/api/external/v1/files/uploads/{upload_id}/parts/{part_number} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/octet-stream' \
--data '"<string>"'import requests
url = "https://app.gc.ai/api/external/v1/files/uploads/{upload_id}/parts/{part_number}"
payload = "<string>"
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/octet-stream"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/octet-stream'},
body: JSON.stringify('<string>')
};
fetch('https://app.gc.ai/api/external/v1/files/uploads/{upload_id}/parts/{part_number}', 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://app.gc.ai/api/external/v1/files/uploads/{upload_id}/parts/{part_number}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode('<string>'),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/octet-stream"
],
]);
$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://app.gc.ai/api/external/v1/files/uploads/{upload_id}/parts/{part_number}"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/octet-stream")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://app.gc.ai/api/external/v1/files/uploads/{upload_id}/parts/{part_number}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/octet-stream")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gc.ai/api/external/v1/files/uploads/{upload_id}/parts/{part_number}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/octet-stream'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_body{
"upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"part_number": 123,
"size": 123
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"details": {}
}Files
Upload a File Part
Upload one part of a chunked upload. The request body is the raw bytes of the part (application/octet-stream). Parts may be uploaded in any order; re-sending the same part_number overwrites it, so a failed part is safe to retry.
PUT
/
files
/
uploads
/
{upload_id}
/
parts
/
{part_number}
Upload a file part
curl --request PUT \
--url https://app.gc.ai/api/external/v1/files/uploads/{upload_id}/parts/{part_number} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/octet-stream' \
--data '"<string>"'import requests
url = "https://app.gc.ai/api/external/v1/files/uploads/{upload_id}/parts/{part_number}"
payload = "<string>"
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/octet-stream"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/octet-stream'},
body: JSON.stringify('<string>')
};
fetch('https://app.gc.ai/api/external/v1/files/uploads/{upload_id}/parts/{part_number}', 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://app.gc.ai/api/external/v1/files/uploads/{upload_id}/parts/{part_number}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode('<string>'),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/octet-stream"
],
]);
$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://app.gc.ai/api/external/v1/files/uploads/{upload_id}/parts/{part_number}"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/octet-stream")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://app.gc.ai/api/external/v1/files/uploads/{upload_id}/parts/{part_number}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/octet-stream")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gc.ai/api/external/v1/files/uploads/{upload_id}/parts/{part_number}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/octet-stream'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_body{
"upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"part_number": 123,
"size": 123
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"details": {}
}Authorizations
API key for authentication. Format: gcai_xxxxxxxxx
Create API keys in the GC AI app under Settings → API.
Path Parameters
The upload session ID from initiate.
Part index, from 1 to 32.
Required range:
1 <= x <= 32Body
application/octet-stream
The body is of type file.
Was this page helpful?
⌘I