跳转到主要内容
GET
/
v3
/
organizations
/
{org_id}
/
pr-reviews
获取最新的 Devin Review 状态
curl --request GET \
  --url https://api.devin.ai/v3/organizations/{org_id}/pr-reviews \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.devin.ai/v3/organizations/{org_id}/pr-reviews"

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}/pr-reviews', 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}/pr-reviews",
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}/pr-reviews"

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}/pr-reviews")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.devin.ai/v3/organizations/{org_id}/pr-reviews")

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
{
  "commit_sha": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "pr_number": 123,
  "repo_path": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

权限

需要服务用户在指定组织中具有 UseReviewManual 权限。

授权

Authorization
string
header
必填

服务用户凭据(前缀:cog_)

路径参数

org_id
string
必填

组织 ID(前缀:org-)

示例:

"org-abc123def456"

查询参数

pr_url
string
必填

要查找的拉取请求/合并请求的完整 URL(例如 https://github.com/owner/repo/pull/123)。

示例:

"https://github.com/owner/repo/pull/123"

commit_sha
string | null

要查找的 commit SHA(完整值或短前缀)。如果省略,则默认使用 PR 当前的 head commit。

示例:

"abc123def4567890abc123def4567890abc123de"

响应

成功响应

commit_sha
string
必填

将被审查的 PR 头部提交的 SHA。

created_at
string<date-time>
必填

审查被接受的时间。

pr_number
integer
必填

拉取/合并请求编号。

repo_path
string
必填

规范化的带主机前缀的代码仓库路径(例如 github.com/owner/repo)。

status
enum<string>
必填

当前审查状态。新接受的审查初始状态为 pending

可用选项:
pending,
running,
completed,
errored,
cancelled