雲尚API

查詢呼叫記錄(call_logs)

回傳 API 呼叫日誌。支援分頁。僅限銷售/管理員角色呼叫。

介面資訊

項目說明
介面位址POST /api.php
actioncall_logs
認證方式全域應用 APP ID / APP KEY
角色限制僅銷售/管理員

請求參數

參數類型必填說明
pageint頁碼,預設 1
limitint每頁筆數,預設 20,最大 50

請求範例

{
    "action": "call_logs",
    "app_id": "68B0FA47FEC9E7EBC4BF80F8",
    "app_key": "2b901515a427b6c0b68f866eece70e0d2ecf687146022412",
    "page": 1,
    "limit": 20
}

PHP

<?php
$app_id = '68B0FA47FEC9E7EBC4BF80F8';
$app_key = '2b901515a427b6c0b68f866eece70e0d2ecf687146022412';
$url = 'https://yunsapi.com/api.php';

$params = [
    'action'  => 'calllogs',
    'app_id'  => $app_id,
    'app_key' => $app_key,
    'page'    => 1,
    'limit'   => 20,
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

$resp = curl_exec($ch);
curl_close($ch);
echo $resp;

Java

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class ApiDemo {
    static final String URL = "https://yunsapi.com/api.php";
    static final String APP_ID = "68B0FA47FEC9E7EBC4BF80F8";
    static final String APP_KEY = "2b901515a427b6c0b68f866eece70e0d2ecf687146022412";

    public static void main(String[] args) throws Exception {
        String body = "{\"action\":\"calllogs\",\"app_id\":\"" + APP_ID + "\",\"app_key\":\"" + APP_KEY + "\",\"page\":1,\"limit\":20}";
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest req = HttpRequest.newBuilder()
                .uri(URI.create(URL))
                .header("Content-Type", "application/json")
                .POST(HttpRequest.BodyPublishers.ofString(body))
                .build();
        HttpResponse<String> resp = client.send(req, HttpResponse.BodyHandlers.ofString());
        System.out.println(resp.body());
    }
}

回應範例

{
    "code": 0,
    "msg": "success",
    "data": {
        "total": 122,
        "page": 1,
        "limit": 20,
        "list": [
            {
                "id": "1853",
                "api_name": "身份證二要素查驗",
                "api_code": "idcard2check",
                "request_params": "{\"name\":\"張三\",\"idcard\":\"340322198202181639\"}",
                "response": "{\"cached\":true}",
                "ip": "36.159.183.92",
                "create_time": "2026-08-13 22:49:09"
            }
        ]
    }
}

回應參數

參數類型說明
data.totalint總筆數
data.list[].idstring日誌 ID
data.list[].api_namestringAPI 名稱
data.list[].api_codestringAPI 程式碼
data.list[].request_paramsstring請求參數(JSON 字串)
data.list[].responsestring回應結果(JSON 字串)
data.list[].ipstring用戶端 IP
data.list[].create_timestring呼叫時間