Get file metadata
curl --request GET \
--url https://api-eu.flexportal.io/v1/files/{fileId} \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/files/{fileId}"
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Tenant-ID': '<tenant-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api-eu.flexportal.io/v1/files/{fileId}', 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-eu.flexportal.io/v1/files/{fileId}",
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>",
"Tenant-ID: <tenant-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"
"net/http"
"io"
)
func main() {
url := "https://api-eu.flexportal.io/v1/files/{fileId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-ID", "<tenant-id>")
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-eu.flexportal.io/v1/files/{fileId}")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/files/{fileId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"fileId": "<string>",
"tenantId": "<string>",
"orderId": "<string>",
"type": "<string>",
"category": "generated",
"filename": "<string>",
"contentType": "<string>",
"fileSize": 123,
"storagePath": "<string>",
"uploadedBy": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"originalFilename": "<string>",
"metadata": {}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Files
Get File
Retrieves metadata for a specific file. Does not return the file content.
GET
/
v1
/
files
/
{fileId}
Get file metadata
curl --request GET \
--url https://api-eu.flexportal.io/v1/files/{fileId} \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/files/{fileId}"
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Tenant-ID': '<tenant-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api-eu.flexportal.io/v1/files/{fileId}', 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-eu.flexportal.io/v1/files/{fileId}",
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>",
"Tenant-ID: <tenant-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"
"net/http"
"io"
)
func main() {
url := "https://api-eu.flexportal.io/v1/files/{fileId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-ID", "<tenant-id>")
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-eu.flexportal.io/v1/files/{fileId}")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/files/{fileId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"fileId": "<string>",
"tenantId": "<string>",
"orderId": "<string>",
"type": "<string>",
"category": "generated",
"filename": "<string>",
"contentType": "<string>",
"fileSize": 123,
"storagePath": "<string>",
"uploadedBy": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"originalFilename": "<string>",
"metadata": {}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Overview
Retrieve metadata for a single file. Use this to get file details before downloading or to verify file properties.Response Fields
| Field | Description |
|---|---|
fileId | Unique file identifier |
fileName | Original file name |
fileType | Type: contract, invoice, document, attachment |
mimeType | MIME type |
size | File size in bytes |
orderId | Associated order ID |
customerId | Associated customer ID |
createdAt | When file was created |
updatedAt | Last modification |
Common Use Cases
- Pre-Download Check: Verify file exists and get metadata
- File Information: Display file details in UI
- Validation: Check file type and size before processing
Example: Display File Info
async function getFileInfo(fileId) {
const file = await getFile(fileId);
return {
name: file.fileName,
type: file.fileType,
size: `${(file.size / 1024).toFixed(1)} KB`,
created: new Date(file.createdAt).toLocaleDateString()
};
}
Related Endpoints
- List Files - Browse all files
- Get File URL - Get download URL
- Delete File - Remove file
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Path Parameters
The file ID
Response
File metadata
Available options:
generated, uploaded Show child attributes
Show child attributes
Was this page helpful?