One problem with its findings
curl --request GET \
--url https://api.outerlayer.ai/v1/problems/{problemId} \
--header 'Authorization: Bearer <token>' \
--header 'X-Outerlayer-App-Id: <api-key>'import requests
url = "https://api.outerlayer.ai/v1/problems/{problemId}"
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Outerlayer-App-Id': '<api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.outerlayer.ai/v1/problems/{problemId}', 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.outerlayer.ai/v1/problems/{problemId}",
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>",
"X-Outerlayer-App-Id: <api-key>"
],
]);
$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.outerlayer.ai/v1/problems/{problemId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
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.outerlayer.ai/v1/problems/{problemId}")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/problems/{problemId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"avgMinutesLost": 123,
"category": "context",
"findingCount": 123,
"findings": [
{
"callerKind": "machine",
"category": "context",
"cause": "<string>",
"codeExcerpt": {
"path": "<string>",
"startLine": 123,
"text": "<string>",
"sha": "<string>"
},
"command": "<string>",
"contextSourceSha": "<string>",
"detail": "<string>",
"error": "<string>",
"file": "<string>",
"headSha": "<string>",
"id": "<string>",
"joinedBy": "strict_key",
"line": 123,
"minutesLost": 123,
"number": 123,
"otherProblems": [
{
"id": "<string>",
"title": "<string>"
}
],
"recordedAt": "<string>",
"recordedBy": "<string>",
"ruleLine": 123,
"rulePath": "<string>",
"ruleQuote": "<string>",
"ruleRelation": "wrong",
"suggestion": "<string>",
"symbol": "<string>",
"test": "<string>",
"title": "<string>",
"transcriptExcerpt": "<string>",
"whereRecorded": {}
}
],
"findingsTruncated": true,
"firstReportedAt": "<string>",
"id": "<string>",
"lastReportedAt": "<string>",
"minutesLost": 123,
"reports": 123,
"strictKeys": [
"<string>"
],
"title": "<string>",
"unmeasuredFindings": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Findings
One problem with its findings
One problem’s figures, as GET /v1/problems returns them (findingCount is the row’s findings), plus its findings, newest recorded first, at most 100 (findingsTruncated says there are more). Each finding carries its cause, suggestion, command, error line, the rule it relates to, how it joined the problem (joinedBy) and the other problems it reports. since and until narrow the figures and the findings to that window.
GET
/
v1
/
problems
/
{problemId}
One problem with its findings
curl --request GET \
--url https://api.outerlayer.ai/v1/problems/{problemId} \
--header 'Authorization: Bearer <token>' \
--header 'X-Outerlayer-App-Id: <api-key>'import requests
url = "https://api.outerlayer.ai/v1/problems/{problemId}"
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Outerlayer-App-Id': '<api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.outerlayer.ai/v1/problems/{problemId}', 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.outerlayer.ai/v1/problems/{problemId}",
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>",
"X-Outerlayer-App-Id: <api-key>"
],
]);
$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.outerlayer.ai/v1/problems/{problemId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
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.outerlayer.ai/v1/problems/{problemId}")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/problems/{problemId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"avgMinutesLost": 123,
"category": "context",
"findingCount": 123,
"findings": [
{
"callerKind": "machine",
"category": "context",
"cause": "<string>",
"codeExcerpt": {
"path": "<string>",
"startLine": 123,
"text": "<string>",
"sha": "<string>"
},
"command": "<string>",
"contextSourceSha": "<string>",
"detail": "<string>",
"error": "<string>",
"file": "<string>",
"headSha": "<string>",
"id": "<string>",
"joinedBy": "strict_key",
"line": 123,
"minutesLost": 123,
"number": 123,
"otherProblems": [
{
"id": "<string>",
"title": "<string>"
}
],
"recordedAt": "<string>",
"recordedBy": "<string>",
"ruleLine": 123,
"rulePath": "<string>",
"ruleQuote": "<string>",
"ruleRelation": "wrong",
"suggestion": "<string>",
"symbol": "<string>",
"test": "<string>",
"title": "<string>",
"transcriptExcerpt": "<string>",
"whereRecorded": {}
}
],
"findingsTruncated": true,
"firstReportedAt": "<string>",
"id": "<string>",
"lastReportedAt": "<string>",
"minutesLost": 123,
"reports": 123,
"strictKeys": [
"<string>"
],
"title": "<string>",
"unmeasuredFindings": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}