嵌入式组件
验证小组件安装
对小组件的配置以及(可选的)实际页面运行预检检查。
POST
/
api
/
v1
/
iframes
/
{id}
/
verify
验证小组件安装
curl --request POST \
--url https://api.example.com/api/v1/iframes/{id}/verify \
--header 'Content-Type: application/json' \
--data '
{
"domain": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/iframes/{id}/verify"
payload = { "domain": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({domain: '<string>'})
};
fetch('https://api.example.com/api/v1/iframes/{id}/verify', 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/v1/iframes/{id}/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'domain' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/iframes/{id}/verify"
payload := strings.NewReader("{\n \"domain\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/iframes/{id}/verify")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/iframes/{id}/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"checks": [
{}
]
}运行一系列检查并返回结果列表。如果未提供
domain,则只检查小组件自身的配置(状态、关联的密钥、域名允许列表)。如果提供了 domain,还会抓取该页面以确认嵌入代码是否存在,并检查页面的 Content-Security-Policy 中是否存在会阻止该小组件运行的指令。
身份验证
需要提供 Bearer 令牌(API 密钥)或仪表盘会话。路径参数
string
必填
小组件配置的 UUID。
请求
string
要检查的页面 URL(可选)。提供后,系统会抓取该页面(带有 SSRF 防护)并扫描其中的嵌入代码片段以及 CSP 相关问题。
响应
array
每项检查包含:
name、status(pass | fail | warn)、message,以及可选的 fix 代码片段(例如需要添加到你的站点中的 CSP 指令)。示例
curl
curl -X POST https://www.hitheo.ai/api/v1/iframes/CONFIG_ID/verify \
-H "Authorization: Bearer $THEO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "domain": "https://example.com/contact" }'
此页面对您有帮助吗?
验证小组件安装
curl --request POST \
--url https://api.example.com/api/v1/iframes/{id}/verify \
--header 'Content-Type: application/json' \
--data '
{
"domain": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/iframes/{id}/verify"
payload = { "domain": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({domain: '<string>'})
};
fetch('https://api.example.com/api/v1/iframes/{id}/verify', 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/v1/iframes/{id}/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'domain' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/iframes/{id}/verify"
payload := strings.NewReader("{\n \"domain\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/iframes/{id}/verify")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/iframes/{id}/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"checks": [
{}
]
}