コードスキャンプロファイルを取得
curl --request GET \
--url https://api.devin.ai/v3/organizations/{org_id}/code-scans/profiles/{profile_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.devin.ai/v3/organizations/{org_id}/code-scans/profiles/{profile_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.devin.ai/v3/organizations/{org_id}/code-scans/profiles/{profile_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.devin.ai/v3/organizations/{org_id}/code-scans/profiles/{profile_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.devin.ai/v3/organizations/{org_id}/code-scans/profiles/{profile_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.devin.ai/v3/organizations/{org_id}/code-scans/profiles/{profile_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/organizations/{org_id}/code-scans/profiles/{profile_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{
"created_at": 123,
"description": "<string>",
"exclude_globs": [
"<string>"
],
"include_globs": [
"<string>"
],
"ingestion_source_guidance": "<string>",
"investigation_guidance": "<string>",
"mode": "discover",
"name": "<string>",
"org_id": "<string>",
"post_ingestion_guidance": "<string>",
"profile_id": "<string>",
"remediation_guidance": "<string>",
"report_guidance": "<string>",
"scan_type": "security",
"threat_model_guidance": "<string>",
"triage_guidance": "<string>",
"validation_guidance": "<string>",
"visibility": "org",
"communication_guidance": "<string>"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}コードスキャン(組織)
コードスキャンプロファイルを取得(Devin API)
v3 組織 API を使用して、モード、スキャンタイプ、包含/除外グロブ、ガイダンスを含む Devin コードスキャンプロファイルを 1 件取得します
GET
/
v3
/
organizations
/
{org_id}
/
code-scans
/
profiles
/
{profile_id}
コードスキャンプロファイルを取得
curl --request GET \
--url https://api.devin.ai/v3/organizations/{org_id}/code-scans/profiles/{profile_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.devin.ai/v3/organizations/{org_id}/code-scans/profiles/{profile_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.devin.ai/v3/organizations/{org_id}/code-scans/profiles/{profile_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.devin.ai/v3/organizations/{org_id}/code-scans/profiles/{profile_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.devin.ai/v3/organizations/{org_id}/code-scans/profiles/{profile_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.devin.ai/v3/organizations/{org_id}/code-scans/profiles/{profile_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/organizations/{org_id}/code-scans/profiles/{profile_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{
"created_at": 123,
"description": "<string>",
"exclude_globs": [
"<string>"
],
"include_globs": [
"<string>"
],
"ingestion_source_guidance": "<string>",
"investigation_guidance": "<string>",
"mode": "discover",
"name": "<string>",
"org_id": "<string>",
"post_ingestion_guidance": "<string>",
"profile_id": "<string>",
"remediation_guidance": "<string>",
"report_guidance": "<string>",
"scan_type": "security",
"threat_model_guidance": "<string>",
"triage_guidance": "<string>",
"validation_guidance": "<string>",
"visibility": "org",
"communication_guidance": "<string>"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}権限
ViewCodeScans 権限を持つサービスユーザーまたはパーソナルアクセストークンが必要です。
動作
404 を返します。承認
サービスユーザーの認証情報(接頭辞: cog_)
レスポンス
成功レスポンス
ガイダンスを含むコードスキャンプロファイルの詳細情報。
プロファイルが作成された日時(Unix 秒)。
プロファイルの説明(ある場合)。
スキャンから除外するファイルの glob パターン(ある場合)。
スキャンに含めるファイルの glob パターン(ある場合)。
取り込みソースを説明するガイダンス(ある場合)。
調査フェーズのガイダンス(ある場合)。
プロファイルモード: discover または ingest。
利用可能なオプション:
discover, ingest プロファイル名。
プロファイルを所有する組織。プロファイルがアカウント全体で共有されている場合は null。
取り込み後フェーズのガイダンス(ある場合)。
プロファイルの一意の識別子。
修復フェーズのガイダンス(ある場合)。
レポートフェーズのガイダンス(ある場合)。
プロファイルが設定するスキャンの種類。
利用可能なオプション:
security, performance, db-queries, test-coverage, dead-code, code-quality, telemetry, accessibility, general, migration-docs 脅威モデルに関するガイダンス(ある場合)。
トリアージ段階に関するガイダンス(ある場合)。
検証段階に関するガイダンス(ある場合)。
このプロファイルが単一の組織に属するか、アカウント全体で共有されるかどうか。
利用可能なオプション:
org, account 通信フェーズ(最終的な検出結果への対応。例: 所有者または関係者への通知)に関するガイダンス(該当する場合)。

