Get one file
curl --request GET \
--url https://api.prod.commenda.io/api/v1/files/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.prod.commenda.io/api/v1/files/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.prod.commenda.io/api/v1/files/{id}', 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.prod.commenda.io/api/v1/files/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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.prod.commenda.io/api/v1/files/{id}"
req, _ := http.NewRequest("GET", 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.get("https://api.prod.commenda.io/api/v1/files/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.commenda.io/api/v1/files/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "example.pdf",
"size": 102400,
"corporation_id": "<string>",
"signed_url": "https://bucket-name.s3.amazonaws.com/example.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20240912%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20240912T120000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6"
},
"message": "Successfully fetched file."
}{
"error": {
"type": "CLIENT_INVALID_REQUEST_BODY",
"doc_url": "https://sales-tax-docs.commenda.io/",
"title": "Failed to validate the request body",
"detail": "<string>",
"status": 400,
"instance": "<string>",
"Errors": [
{
"details": "<string>",
"pointer": "<string>"
}
]
}
}Files
Get file
Retrieve one file by its id, along with a signed URL to download it
GET
/
files
/
{id}
Get one file
curl --request GET \
--url https://api.prod.commenda.io/api/v1/files/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.prod.commenda.io/api/v1/files/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.prod.commenda.io/api/v1/files/{id}', 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.prod.commenda.io/api/v1/files/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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.prod.commenda.io/api/v1/files/{id}"
req, _ := http.NewRequest("GET", 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.get("https://api.prod.commenda.io/api/v1/files/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.commenda.io/api/v1/files/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "example.pdf",
"size": 102400,
"corporation_id": "<string>",
"signed_url": "https://bucket-name.s3.amazonaws.com/example.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20240912%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20240912T120000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6"
},
"message": "Successfully fetched file."
}{
"error": {
"type": "CLIENT_INVALID_REQUEST_BODY",
"doc_url": "https://sales-tax-docs.commenda.io/",
"title": "Failed to validate the request body",
"detail": "<string>",
"status": 400,
"instance": "<string>",
"Errors": [
{
"details": "<string>",
"pointer": "<string>"
}
]
}
}Get a file by id along with a signed URL to download it.
More information coming soon.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the file to fetch.
Was this page helpful?
⌘I