curl --request GET \
--url https://getunblocked.com/api/v1/risk-assessments/{riskAssessmentId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://getunblocked.com/api/v1/risk-assessments/{riskAssessmentId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://getunblocked.com/api/v1/risk-assessments/{riskAssessmentId}', 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://getunblocked.com/api/v1/risk-assessments/{riskAssessmentId}",
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://getunblocked.com/api/v1/risk-assessments/{riskAssessmentId}"
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://getunblocked.com/api/v1/risk-assessments/{riskAssessmentId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://getunblocked.com/api/v1/risk-assessments/{riskAssessmentId}")
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{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "processing",
"gitHeadSha": "8a1b2c3d4e5f678901234567890123456789abcd",
"gitBaseSha": "7a1b2c3d4e5f678901234567890123456789abcd",
"error": "Unable to retrieve the pull request diff.",
"score": "low",
"rationale": "The change is limited to a well-tested validation path."
}{
"status": 400
}{
"status": 400
}{
"status": 400
}{
"status": 400
}{
"status": 400
}{
"status": 400
}Get Risk Assessment
Draft - not available. The specification is subject to change.
Retrieve a risk assessment created through this API for the authenticated team.
Poll while the status is processing. Results are available when the status is complete.
A failed result includes an error message. The commit SHAs identify the analyzed revision,
even if the pull request has since changed.
curl --request GET \
--url https://getunblocked.com/api/v1/risk-assessments/{riskAssessmentId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://getunblocked.com/api/v1/risk-assessments/{riskAssessmentId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://getunblocked.com/api/v1/risk-assessments/{riskAssessmentId}', 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://getunblocked.com/api/v1/risk-assessments/{riskAssessmentId}",
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://getunblocked.com/api/v1/risk-assessments/{riskAssessmentId}"
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://getunblocked.com/api/v1/risk-assessments/{riskAssessmentId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://getunblocked.com/api/v1/risk-assessments/{riskAssessmentId}")
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{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "processing",
"gitHeadSha": "8a1b2c3d4e5f678901234567890123456789abcd",
"gitBaseSha": "7a1b2c3d4e5f678901234567890123456789abcd",
"error": "Unable to retrieve the pull request diff.",
"score": "low",
"rationale": "The change is limited to a well-tested validation path."
}{
"status": 400
}{
"status": 400
}{
"status": 400
}{
"status": 400
}{
"status": 400
}{
"status": 400
}Authorizations
The API key to authenticate requests. Obtainable from the web dashboard.
Path Parameters
The ID returned when the risk assessment was created. The ID of a resource that can be retrieved from the service.
Response
OK - The current status and available result
The ID of a resource that can be retrieved from the service.
The status of an asynchronous run. Poll while processing. Complete and failed are terminal states.
processing, complete, failed "processing"
The head commit SHA analyzed by this risk assessment.
"8a1b2c3d4e5f678901234567890123456789abcd"
The base commit SHA analyzed by this risk assessment.
"7a1b2c3d4e5f678901234567890123456789abcd"
An error message present when status is failed; omitted otherwise.
"Unable to retrieve the pull request diff."
The assessed risk level, present when status is complete; omitted otherwise.
lowest, low, medium, high, highest "low"
The explanation of the risk score in Markdown, present when status is complete; omitted otherwise.
"The change is limited to a well-tested validation path."