应用 - 网络
网络错误
获取应用的 5xx(以及可选的 4xx)边缘错误的聚合明细。
GET
/
v2
/
apps
/
{app_id}
/
network
/
errors
网络错误
curl --request GET \
--url https://api.squarecloud.app/v2/apps/{app_id}/network/errors \
--header 'Authorization: <authorization>'import requests
url = "https://api.squarecloud.app/v2/apps/{app_id}/network/errors"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.squarecloud.app/v2/apps/{app_id}/network/errors', 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.squarecloud.app/v2/apps/{app_id}/network/errors",
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: <authorization>"
],
]);
$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.squarecloud.app/v2/apps/{app_id}/network/errors"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.squarecloud.app/v2/apps/{app_id}/network/errors")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.squarecloud.app/v2/apps/{app_id}/network/errors")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"status": "success",
"response": {
"summary": {
"total": 42,
"by_class": {
"4xx": 0,
"5xx": 42
}
},
"by_status": [
{ "status": 502, "requests": 30 },
{ "status": 504, "requests": 12 }
],
"timeseries": [
{
"date": "2025-12-01T12:00:00.000Z",
"buckets": { "502": 5, "504": 2 },
"total": 7
}
],
"top_paths": [
{
"path": "/api/users",
"method": "GET",
"total": 18,
"by_status": { "502": 15, "504": 3 }
}
],
"by_method": [
{
"method": "GET",
"total": 30,
"by_status": { "502": 22, "504": 8 }
}
]
}
}
返回应用在某一时间窗口内的聚合边缘错误计数,按状态码、时间分桶、请求路径和 HTTP 方法分组。默认仅包含 5xx 响应;传入
include_4xx=true 可同时统计 4xx 响应。
缓存未命中速率限制:每个所有者每 60 秒 15 次请求。当没有匹配的错误,或时间窗口早于应用的创建日期时,返回空明细。
参数
应用的 ID。你可以在应用仪表盘的 URL 中找到它。
分析窗口的 ISO 8601 起始时间戳。
ISO 8601 结束时间戳。必须晚于
start。是否在 5xx 错误之外同时包含 4xx 响应。接受
true 或 false。默认为 false。响应
指示调用是否成功。成功时为
success,否则为 error。该窗口的聚合错误明细。
显示 展开响应对象
显示 展开响应对象
{
"status": "success",
"response": {
"summary": {
"total": 42,
"by_class": {
"4xx": 0,
"5xx": 42
}
},
"by_status": [
{ "status": 502, "requests": 30 },
{ "status": 504, "requests": 12 }
],
"timeseries": [
{
"date": "2025-12-01T12:00:00.000Z",
"buckets": { "502": 5, "504": 2 },
"total": 7
}
],
"top_paths": [
{
"path": "/api/users",
"method": "GET",
"total": 18,
"by_status": { "502": 15, "504": 3 }
}
],
"by_method": [
{
"method": "GET",
"total": 30,
"by_status": { "502": 22, "504": 8 }
}
]
}
}
⌘I
网络错误
curl --request GET \
--url https://api.squarecloud.app/v2/apps/{app_id}/network/errors \
--header 'Authorization: <authorization>'import requests
url = "https://api.squarecloud.app/v2/apps/{app_id}/network/errors"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.squarecloud.app/v2/apps/{app_id}/network/errors', 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.squarecloud.app/v2/apps/{app_id}/network/errors",
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: <authorization>"
],
]);
$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.squarecloud.app/v2/apps/{app_id}/network/errors"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.squarecloud.app/v2/apps/{app_id}/network/errors")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.squarecloud.app/v2/apps/{app_id}/network/errors")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"status": "success",
"response": {
"summary": {
"total": 42,
"by_class": {
"4xx": 0,
"5xx": 42
}
},
"by_status": [
{ "status": 502, "requests": 30 },
{ "status": 504, "requests": 12 }
],
"timeseries": [
{
"date": "2025-12-01T12:00:00.000Z",
"buckets": { "502": 5, "504": 2 },
"total": 7
}
],
"top_paths": [
{
"path": "/api/users",
"method": "GET",
"total": 18,
"by_status": { "502": 15, "504": 3 }
}
],
"by_method": [
{
"method": "GET",
"total": 30,
"by_status": { "502": 22, "504": 8 }
}
]
}
}

