Upload file
curl --request POST \
--url https://app.silnahealth.com/api/public/v1/files/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/octet-stream' \
--header 'original-filename: <original-filename>' \
--header 'provider-id: <provider-id>' \
--data '"<string>"'import requests
url = "https://app.silnahealth.com/api/public/v1/files/"
payload = "<string>"
headers = {
"provider-id": "<provider-id>",
"original-filename": "<original-filename>",
"Authorization": "Bearer <token>",
"Content-Type": "application/octet-stream"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'provider-id': '<provider-id>',
'original-filename': '<original-filename>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/octet-stream'
},
body: JSON.stringify('<string>')
};
fetch('https://app.silnahealth.com/api/public/v1/files/', 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.silnahealth.com/api/public/v1/files/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode('<string>'),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/octet-stream",
"original-filename: <original-filename>",
"provider-id: <provider-id>"
],
]);
$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.silnahealth.com/api/public/v1/files/"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("provider-id", "<provider-id>")
req.Header.Add("original-filename", "<original-filename>")
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.post("https://app.silnahealth.com/api/public/v1/files/")
.header("provider-id", "<provider-id>")
.header("original-filename", "<original-filename>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/octet-stream")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.silnahealth.com/api/public/v1/files/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["provider-id"] = '<provider-id>'
request["original-filename"] = '<original-filename>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/octet-stream'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Files
Upload file
POST
/
public
/
v1
/
files
/
Upload file
curl --request POST \
--url https://app.silnahealth.com/api/public/v1/files/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/octet-stream' \
--header 'original-filename: <original-filename>' \
--header 'provider-id: <provider-id>' \
--data '"<string>"'import requests
url = "https://app.silnahealth.com/api/public/v1/files/"
payload = "<string>"
headers = {
"provider-id": "<provider-id>",
"original-filename": "<original-filename>",
"Authorization": "Bearer <token>",
"Content-Type": "application/octet-stream"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'provider-id': '<provider-id>',
'original-filename': '<original-filename>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/octet-stream'
},
body: JSON.stringify('<string>')
};
fetch('https://app.silnahealth.com/api/public/v1/files/', 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.silnahealth.com/api/public/v1/files/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode('<string>'),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/octet-stream",
"original-filename: <original-filename>",
"provider-id: <provider-id>"
],
]);
$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.silnahealth.com/api/public/v1/files/"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("provider-id", "<provider-id>")
req.Header.Add("original-filename", "<original-filename>")
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.post("https://app.silnahealth.com/api/public/v1/files/")
.header("provider-id", "<provider-id>")
.header("original-filename", "<original-filename>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/octet-stream")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.silnahealth.com/api/public/v1/files/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["provider-id"] = '<provider-id>'
request["original-filename"] = '<original-filename>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/octet-stream'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}We support uploads up to 50 MB. If you have files larger than this, please reach out to request a limit increase.
The generated code examples are slightly incorrect in how they handle file uploads. Please use the below cURL and python examples.
cURL Example
curl -X POST "https://api.silnahealth.com/public/v1/files/" \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/octet-stream" \
-H "provider-id: 0194a907-5bdc-7f94-b890-b9afc5b5d5e3" \
-H "original-filename: test_two.pdf" \
--data-binary @test_two.pdf
Python Example
import requests
url = "https://api.silnahealth.com/public/v1/files/"
headers = {
"Authorization": "Bearer {TOKEN}",
"Content-Type": "application/octet-stream",
"provider-id": "0194a907-5bdc-7f94-b890-b9afc5b5d5e3",
"original-filename": "test_two.pdf"
}
with open("test_two.pdf", "rb") as file:
response = requests.post(url, headers=headers, data=file)
print(response.status_code)
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The name of the file you are uploading
Body
application/octet-stream
Binary file content to upload
The body is of type file.
Response
⌘I