Skip to content

查看隐私与安全

接口信息

  • 接口: /agent-api/user/{user_id}/settings/get_security
  • 请求方式: GET

路由参数

参数类型示例解释必填
user_idstring5832d184-dd53-42a0-8ace-0bf8d660f4cc用户id

请求示例

cURL
curl -X GET "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/settings/get_security" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"
Go
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    url := "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/settings/get_security"

    req, _ := http.NewRequest("GET", url, nil)
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Authorization", "Bearer YOUR_TOKEN")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
JavaScript
const url = 'https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/settings/get_security';

fetch(url, {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer YOUR_TOKEN'
    }
})
    .then(response => response.json())
    .then(result => console.log(result))
    .catch(error => console.error('Error:', error));
Java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Main {
    public static void main(String[] args) throws Exception {
        String urlString = "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/settings/get_security";
        URL url = new URL(urlString);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();

        conn.setRequestMethod("GET");
        conn.setRequestProperty("Content-Type", "application/json");
        conn.setRequestProperty("Authorization", "Bearer YOUR_TOKEN");

        BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        String inputLine;
        StringBuilder response = new StringBuilder();

        while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
        in.close();

        System.out.println(response.toString());
    }
}
PHP
<?php

$url = 'https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/settings/get_security';

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'Authorization: Bearer YOUR_TOKEN'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
Python
import requests

url = 'https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/settings/get_security'

headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_TOKEN'
}

response = requests.get(url, headers=headers)
print(response.json())
C++
#include <iostream>
#include <string>
#include <curl/curl.h>

int main() {
    CURL* curl;
    CURLcode res;
    curl = curl_easy_init();

    if (curl) {
        std::string url = "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/settings/get_security";

        struct curl_slist* headers = NULL;
        headers = curl_slist_append(headers, "Content-Type: application/json");
        headers = curl_slist_append(headers, "Authorization: Bearer YOUR_TOKEN");

        curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);

        res = curl_easy_perform(curl);

        if (res != CURLE_OK)
            std::cerr << "curl_easy_perform() failed: " << curl_easy_strerror(res) << std::endl;

        curl_easy_cleanup(curl);
    }
    return 0;
}

返回数据

json
{
    "code": 200,
    "status": "success",
    "message": "查看用户隐私与安全成功",
    "data": {
        "init_security": {
            "disable_crm_phone": "客户公海",
            "disable_task_phone": "电话号码",
            "disable_record_phone": "通话记录",
            "disable_artificial_outbound_phone": "人工呼出",
            "disable_customer_management_phone": "客户管理",
            "disable_wechat_phone": "微信通知号码"
        },
        "user_security": [
            {
                "slug": "disable_crm_phone",
                "name": "客户公海",
                "status": 1,
                "extra": {
                    "style": 1
                }
            }
        ],
        "code": true
    }
}

字段说明

字段说明
init_security用户可以设置的隐私与安全选项
user_security用户已有的隐私与安全设置
slug加密号码的类型
style加密方式:1-隐藏号码中间4位,2-隐藏全部号码
code是否设置安全码

基于 MIT 许可发布