cURL
curl --request POST \ --url https://api.silnahealth.com/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>"'
{ "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
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
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)
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
The name of the file you are uploading
Binary file content to upload
The body is of type file.
file