Appearance
设置隐私与安全
请求信息
- 接口:
/agent-api/user/{user_id}/settings/save_security - 请求方式:
POST
路由参数
| 参数 | 类型 | 示例 | 解释 | 必填 |
|---|---|---|---|---|
| user_id | string | 5832d184-dd53-42a0-8ace-0bf8d660f4cc | 用户id(主账号) | 是 |
请求参数
| 参数 | 类型 | 示例 | 解释 | 必填 |
|---|---|---|---|---|
| data | array | 见请求示例 | 加密设置数组,传空数组则表示不进行任何的加密设置 | 是 |
| code | string | 123456 | 安全码 | 是 |
请求示例
cURL
curl -X POST "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/settings/save_security" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"data": [ //data传空数组则表示不进行任何的加密设置
{"slug": "disable_crm_phone", "extra": {"style": 1}}, //不传此json则表示不进行此设置
{"slug": "disable_task_phone", "extra": {"style": 1}},
{"slug": "disable_record_phone", "extra": {"style": 1}},
{"slug": "disable_artificial_outbound_phone", "extra": {"style": 1}},
{"slug": "disable_customer_management_phone", "extra": {"style": 1}},
{"slug": "disable_wechat_phone", "extra": {"style": 1}}
],
"code": "123456"
}'Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/settings/save_security"
payload := strings.NewReader(`{
"data": [ //data传空数组则表示不进行任何的加密设置
{"slug": "disable_crm_phone", "extra": {"style": 1}}, //不传此json则表示不进行此设置
{"slug": "disable_task_phone", "extra": {"style": 1}},
{"slug": "disable_record_phone", "extra": {"style": 1}},
{"slug": "disable_artificial_outbound_phone", "extra": {"style": 1}},
{"slug": "disable_customer_management_phone", "extra": {"style": 1}},
{"slug": "disable_wechat_phone", "extra": {"style": 1}}
],
"code": "123456"
}`)
req, _ := http.NewRequest("POST", url, payload)
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 axios = require('axios');
axios.post('https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/settings/save_security', {
data: [ //data传空数组则表示不进行任何的加密设置
{slug: 'disable_crm_phone', extra: {style: 1}}, //不传此json则表示不进行此设置
{slug: 'disable_task_phone', extra: {style: 1}},
{slug: 'disable_record_phone', extra: {style: 1}},
{slug: 'disable_artificial_outbound_phone', extra: {style: 1}},
{slug: 'disable_customer_management_phone', extra: {style: 1}},
{slug: 'disable_wechat_phone', extra: {style: 1}}
],
code: '123456'
}, {
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/settings/save_security";
String json = """
{
"data": [ //data传空数组则表示不进行任何的加密设置
{"slug": "disable_crm_phone", "extra": {"style": 1}}, //不传此json则表示不进行此设置
{"slug": "disable_task_phone", "extra": {"style": 1}},
{"slug": "disable_record_phone", "extra": {"style": 1}},
{"slug": "disable_artificial_outbound_phone", "extra": {"style": 1}},
{"slug": "disable_customer_management_phone", "extra": {"style": 1}},
{"slug": "disable_wechat_phone", "extra": {"style": 1}}
],
"code": "123456"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer YOUR_TOKEN")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}PHP
<?php
$url = 'https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/settings/save_security';
$data = json_encode([
'data' => [ //data传空数组则表示不进行任何的加密设置
['slug' => 'disable_crm_phone', 'extra' => ['style' => 1]], //不传此json则表示不进行此设置
['slug' => 'disable_task_phone', 'extra' => ['style' => 1]],
['slug' => 'disable_record_phone', 'extra' => ['style' => 1]],
['slug' => 'disable_artificial_outbound_phone', 'extra' => ['style' => 1]],
['slug' => 'disable_customer_management_phone', 'extra' => ['style' => 1]],
['slug' => 'disable_wechat_phone', 'extra' => ['style' => 1]]
],
'code' => '123456'
]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer YOUR_TOKEN'
]);
$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/save_security'
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
data = {
'data': [ #data传空数组则表示不进行任何的加密设置
{'slug': 'disable_crm_phone', 'extra': {'style': 1}}, #不传此json则表示不进行此设置
{'slug': 'disable_task_phone', 'extra': {'style': 1}},
{'slug': 'disable_record_phone', 'extra': {'style': 1}},
{'slug': 'disable_artificial_outbound_phone', 'extra': {'style': 1}},
{'slug': 'disable_customer_management_phone', 'extra': {'style': 1}},
{'slug': 'disable_wechat_phone', 'extra': {'style': 1}}
],
'code': '123456'
}
response = requests.post(url, json=data, headers=headers)
print(response.json())C++
#include <iostream>
#include <string>
#include <curl/curl.h>
size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp) {
((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb;
}
int main() {
CURL* curl;
CURLcode res;
std::string readBuffer;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/settings/save_security");
curl_easy_setopt(curl, CURLOPT_POST, 1L);
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_HTTPHEADER, headers);
std::string postData = R"({
"data": [ //data传空数组则表示不进行任何的加密设置
{"slug": "disable_crm_phone", "extra": {"style": 1}}, //不传此json则表示不进行此设置
{"slug": "disable_task_phone", "extra": {"style": 1}},
{"slug": "disable_record_phone", "extra": {"style": 1}},
{"slug": "disable_artificial_outbound_phone", "extra": {"style": 1}},
{"slug": "disable_customer_management_phone", "extra": {"style": 1}},
{"slug": "disable_wechat_phone", "extra": {"style": 1}}
],
"code": "123456"
})";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postData.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
res = curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
std::cout << readBuffer << std::endl;
}
return 0;
}响应示例
状态码:200 OK
json
{
"code": 200,
"status": "success",
"message": "保存用户隐私与安全成功",
"data": []
}字段说明
slug:表示加密号码的类型,取值为:disable_crm_phone:加密客户公海号码disable_task_phone:加密任务号码disable_record_phone:加密通话记录号码disable_artificial_outbound_phone:加密人工外呼号码disable_customer_management_phone:加密客户管理号码disable_wechat_phone:加密微信通知号码
style:表示加密号码的方式,可取值1或者2,1表示隐藏号码中间4位,2表示隐藏全部号码,表现形式为带*(星号)code:表示安全码data传空数组则表示不进行任何的加密设置- 不传某个slug的json则表示不进行此设置