curl --request GET \
--url https://api.example.com/api/v0/repositories/{repo_id}/files/metadata/{path}import requests
url = "https://api.example.com/api/v0/repositories/{repo_id}/files/metadata/{path}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v0/repositories/{repo_id}/files/metadata/{path}', 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/v0/repositories/{repo_id}/files/metadata/{path}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/v0/repositories/{repo_id}/files/metadata/{path}"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/v0/repositories/{repo_id}/files/metadata/{path}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v0/repositories/{repo_id}/files/metadata/{path}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"path": "<string>",
"symbolicLink": true,
"inScope": true,
"mode": 123,
"size": 123,
"lastModified": "2023-11-07T05:31:56Z",
"relatedFindings": 123,
"language": "<string>",
"highestSeverity": "critical"
}{
"type": "email_not_verified",
"msg": "<string>"
}{
"type": "email_not_verified",
"msg": "<string>"
}{
"type": "email_not_verified",
"msg": "<string>"
}{
"type": "email_not_verified",
"msg": "<string>"
}{
"type": "email_not_verified",
"msg": "<string>"
}Get the metadata of a single file.
Access control rules
- The requester must have access to the repository.
curl --request GET \
--url https://api.example.com/api/v0/repositories/{repo_id}/files/metadata/{path}import requests
url = "https://api.example.com/api/v0/repositories/{repo_id}/files/metadata/{path}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v0/repositories/{repo_id}/files/metadata/{path}', 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/v0/repositories/{repo_id}/files/metadata/{path}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/v0/repositories/{repo_id}/files/metadata/{path}"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/v0/repositories/{repo_id}/files/metadata/{path}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v0/repositories/{repo_id}/files/metadata/{path}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"path": "<string>",
"symbolicLink": true,
"inScope": true,
"mode": 123,
"size": 123,
"lastModified": "2023-11-07T05:31:56Z",
"relatedFindings": 123,
"language": "<string>",
"highestSeverity": "critical"
}{
"type": "email_not_verified",
"msg": "<string>"
}{
"type": "email_not_verified",
"msg": "<string>"
}{
"type": "email_not_verified",
"msg": "<string>"
}{
"type": "email_not_verified",
"msg": "<string>"
}{
"type": "email_not_verified",
"msg": "<string>"
}Response
Metadata of file
Metadata about a file in a repository.
Path to the file, relative to the root of the repository, e.g.
directory/README.md.
True if the file is a symbolic link.
True if the file is considered in scope for reporting finding.
File permissions, commonly know as "file mode".
Size of the file in bytes.
Timestamp when the file was last modified.
Number of findings related to this file.
Note that the amount is limited to the finding the user has access to. For example for reviewers this means only the finding of their team are counted.
If this is zero highest_severity will be null.
Detected programming language used in the file. Null if the the language couldn't be determined.
Highest severity in the findings related to this file.
Like related_findings this is based on the findings the user has
access to, which means it will differ depending on what kind of access
the user has.
This will be null if the file has no findings related in it.
critical, high, medium, low, informational, gas_optimization