Salt la conținut
Documentație

Caută în documentație

    English

    Conversații

    Trimite o întrebare și citește răspunsul cu pasajele citate.

    Pe această pagină

    Pune o întrebare

    POST /ai/v1/conversations

    Corpul cererii

    CâmpTipObligatoriuDescriere
    operationId string (uuid) Daobligatoriu UUID ales de client.
    expectedRevision integer Daobligatoriu Revizia înregistrării.
    question string Daobligatoriu Întrebarea introdusă pentru căutare.
    scope string Daobligatoriu Sursele în care se caută. Una dintre all, sales, contracts
    language string Daobligatoriu Limba răspunsului. Una dintre en, ro
    conversationId string Daobligatoriu Identificator stabil.

    Răspunsuri

    StareDescriereCorp
    202 Urmărește rezultatul prin citirea operației. OperationResult
    400 Cererea nu poate fi citită sau încalcă contractul: JSON greșit, un câmp lipsă sau necunoscut, un tip greșit. fields numește fiecare câmp. Error
    401 Tokenul lipsește, a expirat sau nu este al nostru. Error
    403 Tokenul nu dă acces la această societate sau operație. Error
    409 expectedRevision este mai vechi decât înregistrarea. Error
    429 Prea multe cereri. Retry-After indică secundele. Error
    503 Serviciul nu poate răspunde acum. Error

    Cerere

    curl

    curl -X POST "$RDC_BASE_URL/ai/v1/conversations" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "question": "What payment term did we agree with Hanul Ozana?",
      "scope": "all",
      "language": "en",
      "operationId": "86c4fe37-99d4-4bfc-a8f1-347afc902a56",
      "expectedRevision": 0,
      "conversationId": "review-1042"
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/ai/v1/conversations`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "question": "What payment term did we agree with Hanul Ozana?",
        "scope": "all",
        "language": "en",
        "operationId": "86c4fe37-99d4-4bfc-a8f1-347afc902a56",
        "expectedRevision": 0,
        "conversationId": "review-1042"
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/ai/v1/conversations',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'question': 'What payment term did we agree with Hanul Ozana?',
            'scope': 'all',
            'language': 'en',
            'operationId': '86c4fe37-99d4-4bfc-a8f1-347afc902a56',
            'expectedRevision': 0,
            'conversationId': 'review-1042',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "question": "What payment term did we agree with Hanul Ozana?",
      "scope": "all",
      "language": "en",
      "operationId": "86c4fe37-99d4-4bfc-a8f1-347afc902a56",
      "expectedRevision": 0,
      "conversationId": "review-1042"
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/ai/v1/conversations');
    curl_setopt_array($curl, [
        CURLOPT_CUSTOMREQUEST => 'POST',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . getenv('RDC_TOKEN'),
            'Content-Type: application/json',
        ],
        CURLOPT_POSTFIELDS => $body,
    ]);
    $result = json_decode(curl_exec($curl), true);
    curl_close($curl);

    C#

    using System.Net.Http.Headers;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/ai/v1/conversations");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "question": "What payment term did we agree with Hanul Ozana?",
      "scope": "all",
      "language": "en",
      "operationId": "86c4fe37-99d4-4bfc-a8f1-347afc902a56",
      "expectedRevision": 0,
      "conversationId": "review-1042"
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Răspuns 202

    JSON

    {
      "operationId": "86c4fe37-99d4-4bfc-a8f1-347afc902a56",
      "status": "accepted",
      "aggregateRevision": 1
    }

    Citește răspunsul și citările

    GET /ai/v1/conversations/{conversationId}

    Parametri

    NumeÎnTipObligatoriuDescriere
    conversationId path string Daobligatoriu Identificatorul conversației.

    Răspunsuri

    StareDescriereCorp
    200 Rezultatul curent. Conversation
    400 Cererea nu poate fi citită sau încalcă contractul: JSON greșit, un câmp lipsă sau necunoscut, un tip greșit. fields numește fiecare câmp. Error
    401 Tokenul lipsește, a expirat sau nu este al nostru. Error
    403 Tokenul nu dă acces la această societate sau operație. Error
    404 Înregistrarea nu există pentru această societate. Error
    429 Prea multe cereri. Retry-After indică secundele. Error
    503 Serviciul nu poate răspunde acum. Error

    Cerere

    curl

    curl "$RDC_BASE_URL/ai/v1/conversations/review-1042" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/ai/v1/conversations/review-1042`, {
      method: 'GET',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
      },
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'GET',
        f'{os.environ["RDC_BASE_URL"]}/ai/v1/conversations/review-1042',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/ai/v1/conversations/review-1042');
    curl_setopt_array($curl, [
        CURLOPT_CUSTOMREQUEST => 'GET',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        ],
    ]);
    $result = json_decode(curl_exec($curl), true);
    curl_close($curl);

    C#

    using System.Net.Http.Headers;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/ai/v1/conversations/review-1042");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Răspuns 200

    JSON

    {
      "id": "review-1042",
      "revision": 1,
      "status": "answered",
      "answer": "Hanul Ozana pays by bank transfer at the end of the month after delivery. [1] Clause 6.2 of the contract sets the last day of the month after delivery as the due date. [2] On orders delivered in parts, the period starts with the last delivery. [3]",
      "citations": [
        {
          "id": "account",
          "system": "CRM",
          "title": "Hanul Ozana account notes",
          "owner": "Andrei Pop",
          "changed": "2026-11-17T15:40:00Z",
          "path": "/sales/hanul-ozana",
          "scope": "sales",
          "passage": "Hanul Ozana pays by bank transfer at the end of the month after delivery.",
          "number": 1,
          "canRead": true
        },
        {
          "id": "contract",
          "system": "DMS",
          "title": "Payment terms",
          "owner": "Ioana Marin",
          "changed": "2026-09-03T10:30:00Z",
          "path": "/contracts/payment",
          "scope": "contracts",
          "passage": "Clause 6.2 of the contract sets the last day of the month after delivery as the due date.",
          "number": 2,
          "canRead": true
        },
        {
          "id": "annex",
          "system": "DMS",
          "title": "Payment annex",
          "owner": "Ana Rusu",
          "changed": "2026-10-21T13:10:00Z",
          "path": "/contracts/payment-annex",
          "scope": "contracts",
          "passage": "On orders delivered in parts, the period starts with the last delivery.",
          "number": 3,
          "canRead": true
        }
      ],
      "hiddenCount": 0
    }