Skip to content

通话记录修改意向标签

接口信息

  • 接口: /agent-api/settings/{user_id}/record_intention/{record_id}
  • 请求方式: PUT

路由参数

参数类型必填描述
user_idstringY账号 ID
record_idstringY通话记录 ID

请求参数

参数类型必填描述
intention_resultsintY修改意向标签 1:A 级,2:B 级,3:C 级,4:D 级,5:E 级
reasonstringY修改原因
sub_user_idstringN子账户 id(传递此参数则是对子账户操作)
task_idstringY通话记录 id 所属的任务 id

请求示例

cURL
curl -X PUT "https://ai.api.longlonglong.cn/agent-api/settings/40863af8-db4a-41c6-a269-eb5bc386d97f/record_intention/c3e4c267-db5f-42a5-90d4-423db8325054" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "intention_results": 2,
    "reason": "",
    "task_id": "4ab03ec3-2e31-4d85-9f76-cfdeacacf8c0"
  }'
Go
package main

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

func main() {
    jsonData := []byte(`{
        "intention_results": 2,
        "reason": "",
        "task_id": "4ab03ec3-2e31-4d85-9f76-cfdeacacf8c0"
    }`)

    client := &http.Client{}
    req, err := http.NewRequest("PUT", "https://ai.api.longlonglong.cn/agent-api/settings/40863af8-db4a-41c6-a269-eb5bc386d97f/record_intention/c3e4c267-db5f-42a5-90d4-423db8325054", bytes.NewBuffer(jsonData))
    if err != nil {
        panic(err)
    }
    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("Authorization", "Bearer YOUR_TOKEN")

    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');

const response = await axios.put(
  'https://ai.api.longlonglong.cn/agent-api/settings/40863af8-db4a-41c6-a269-eb5bc386d97f/record_intention/c3e4c267-db5f-42a5-90d4-423db8325054',
  {
    intention_results: 2,
    reason: '',
    task_id: '4ab03ec3-2e31-4d85-9f76-cfdeacacf8c0'
  },
  {
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer YOUR_TOKEN'
    }
  }
);

console.log(response.data);
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 {
        HttpClient client = HttpClient.newHttpClient();
        String body = "{\"intention_results\":2,\"reason\":\"\",\"task_id\":\"4ab03ec3-2e31-4d85-9f76-cfdeacacf8c0\"}";
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://ai.api.longlonglong.cn/agent-api/settings/40863af8-db4a-41c6-a269-eb5bc386d97f/record_intention/c3e4c267-db5f-42a5-90d4-423db8325054"))
            .header("Content-Type", "application/json")
            .header("Authorization", "Bearer YOUR_TOKEN")
            .PUT(HttpRequest.BodyPublishers.ofString(body))
            .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
PHP
<?php

$curl = curl_init();

$data = [
    'intention_results' => 2,
    'reason' => '',
    'task_id' => '4ab03ec3-2e31-4d85-9f76-cfdeacacf8c0'
];

curl_setopt_array($curl, [
    CURLOPT_URL => 'https://ai.api.longlonglong.cn/agent-api/settings/40863af8-db4a-41c6-a269-eb5bc386d97f/record_intention/c3e4c267-db5f-42a5-90d4-423db8325054',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_POSTFIELDS => json_encode($data),
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'Authorization: Bearer YOUR_TOKEN'
    ],
]);

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

echo $response;
Python
import requests

url = 'https://ai.api.longlonglong.cn/agent-api/settings/40863af8-db4a-41c6-a269-eb5bc386d97f/record_intention/c3e4c267-db5f-42a5-90d4-423db8325054'
headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_TOKEN'
}
data = {
    'intention_results': 2,
    'reason': '',
    'task_id': '4ab03ec3-2e31-4d85-9f76-cfdeacacf8c0'
}

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

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) {
        struct curl_slist* headers = NULL;
        headers = curl_slist_append(headers, "Content-Type: application/json");
        headers = curl_slist_append(headers, "Authorization: Bearer YOUR_TOKEN");

        std::string json_data = R"({"intention_results":2,"reason":"","task_id":"4ab03ec3-2e31-4d85-9f76-cfdeacacf8c0"})";

        curl_easy_setopt(curl, CURLOPT_URL, "https://ai.api.longlonglong.cn/agent-api/settings/40863af8-db4a-41c6-a269-eb5bc386d97f/record_intention/c3e4c267-db5f-42a5-90d4-423db8325054");
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
        curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PUT");
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, json_data.c_str());
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);

        res = curl_easy_perform(curl);
        if(res != CURLE_OK)
            fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
        else
            std::cout << readBuffer << std::endl;

        curl_easy_cleanup(curl);
    }
    return 0;
}

请求URL示例

PUT /agent-api/settings/40863af8-db4a-41c6-a269-eb5bc386d97f/record_intention/c3e4c267-db5f-42a5-90d4-423db8325054

成功响应

状态码:200 OK

json
{
    "code": 200,
    "status": "success",
    "message": "修改意向标签成功",
    "data": []
}

基于 MIT 许可发布