Upload direct deployment file content
curl --request PUT \
--url https://api.example.com/api/deployments/{id}/files/{fileId}/content \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/octet-stream' \
--data '"<string>"'import requests
url = "https://api.example.com/api/deployments/{id}/files/{fileId}/content"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/octet-stream"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/octet-stream'},
body: JSON.stringify('<string>')
};
fetch('https://api.example.com/api/deployments/{id}/files/{fileId}/content', 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.example.com/api/deployments/{id}/files/{fileId}/content",
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: Bearer <token>",
"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://api.example.com/api/deployments/{id}/files/{fileId}/content"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.example.com/api/deployments/{id}/files/{fileId}/content")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/octet-stream")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/deployments/{id}/files/{fileId}/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/octet-stream'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_body{
"path": "src/App.tsx",
"sha": "<string>",
"size": 1,
"fileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"uploadedAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"nextActions": "<string>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"nextActions": "<string>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"nextActions": "<string>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"nextActions": "<string>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"nextActions": "<string>"
}Admin
Upload direct deployment file content
Streams one registered file through InsForge to the provider. The request body must match the manifest size and SHA-1 digest.
PUT
/
api
/
deployments
/
{id}
/
files
/
{fileId}
/
content
Upload direct deployment file content
curl --request PUT \
--url https://api.example.com/api/deployments/{id}/files/{fileId}/content \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/octet-stream' \
--data '"<string>"'import requests
url = "https://api.example.com/api/deployments/{id}/files/{fileId}/content"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/octet-stream"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/octet-stream'},
body: JSON.stringify('<string>')
};
fetch('https://api.example.com/api/deployments/{id}/files/{fileId}/content', 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.example.com/api/deployments/{id}/files/{fileId}/content",
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: Bearer <token>",
"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://api.example.com/api/deployments/{id}/files/{fileId}/content"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.example.com/api/deployments/{id}/files/{fileId}/content")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/octet-stream")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/deployments/{id}/files/{fileId}/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/octet-stream'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_body{
"path": "src/App.tsx",
"sha": "<string>",
"size": 1,
"fileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"uploadedAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"nextActions": "<string>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"nextActions": "<string>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"nextActions": "<string>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"nextActions": "<string>"
}{
"error": "<string>",
"message": "<string>",
"statusCode": 123,
"nextActions": "<string>"
}Authorizations
bearerAuthapiKey
Project admin JWT or an API key passed as a Bearer token.
Path Parameters
Deployment run ID.
Direct upload file ID returned by POST /api/deployments/direct.
Body
application/octet-stream
The body is of type file.
Response
File uploaded
Relative source path using forward slashes.
Required string length:
1 - 2048Example:
"src/App.tsx"
SHA-1 hex digest of the file content.
Pattern:
^[a-fA-F0-9]{40}$File size in bytes.
Required range:
x >= 0Was this page helpful?
⌘I