| @@ -90,8 +90,9 @@ | ||
| 90 | 90 | $base_url = trailingslashit(get_rest_url(null, 'mxchat/v1')); |
| 91 | 91 | $health_url = $base_url . 'health'; |
| 92 | 92 | $transcripts_u = $base_url . 'transcripts'; |
| 93 | 93 | $knowledge_url = $base_url . 'knowledge'; |
| 94 | + $leads_url = $base_url . 'leads'; | |
| 94 | 95 | |
| 95 | 96 | $plugin_url = plugin_dir_url(dirname(__FILE__)); |
| 96 | 97 | $masked = $token_set |
| 97 | 98 | ? substr($stored_token, 0, 4) . str_repeat('•', 24) . substr($stored_token, -4) |
| @@ -350,8 +351,20 @@ | ||
| 350 | 351 | <td><?php esc_html_e('Push content into the knowledge base. Body: content, source_url, optional bot_id and content_type.', 'mxchat'); ?></td> |
| 351 | 352 | </tr> |
| 352 | 353 | <tr> |
| 353 | 354 | <td><span class="mxch-api-method mxch-api-method-delete">DELETE</span></td> |
| 355 | + <td><code><?php echo esc_html($knowledge_url); ?></code></td> | |
| 356 | + <td><span class="mxch-api-auth mxch-api-auth-bearer"><?php esc_html_e('Bearer', 'mxchat'); ?></span></td> | |
| 357 | + <td><?php esc_html_e('Remove knowledge entries by source_url — one, or an array of up to 50. Removing a URL that is not stored reports deleted:false rather than failing, so a sync job can re-run safely.', 'mxchat'); ?></td> | |
| 358 | + </tr> | |
| 359 | + <tr> | |
| 360 | + <td><span class="mxch-api-method mxch-api-method-get">GET</span></td> | |
| 361 | + <td><code><?php echo esc_html($leads_url); ?></code></td> | |
| 362 | + <td><span class="mxch-api-auth mxch-api-auth-bearer"><?php esc_html_e('Bearer', 'mxchat'); ?></span></td> | |
| 363 | + <td><?php esc_html_e('Read lead-capture submissions — the same rows the Leads tab shows, with consent state. Filterable by since, search and status; supports page + per_page pagination (max 200).', 'mxchat'); ?></td> | |
| 364 | + </tr> | |
| 365 | + <tr> | |
| 366 | + <td><span class="mxch-api-method mxch-api-method-delete">DELETE</span></td> | |
| 354 | 367 | <td><code><?php echo esc_html($transcripts_u); ?></code></td> |
| 355 | 368 | <td><span class="mxch-api-auth mxch-api-auth-bearer"><?php esc_html_e('Bearer', 'mxchat'); ?></span></td> |
| 356 | 369 | <td><?php esc_html_e('Bulk-delete chat sessions by session_id, with optional cascade to translations and click-tracking. Capped at 1000 per call.', 'mxchat'); ?></td> |
| 357 | 370 | </tr> |
| @@ -396,8 +409,32 @@ | ||
| 396 | 409 | <pre class="mxch-api-codeblock"><code>curl -X POST -H "Authorization: Bearer YOUR_TOKEN" \ |
| 397 | 410 | -H "Content-Type: application/json" \ |
| 398 | 411 | -d '{"content":"Q: How do I enable streaming?\nA: ...","source_url":"https://example.com/faq#streaming","content_type":"faq"}' \ |
| 399 | 412 | "<?php echo esc_html($knowledge_url); ?>"</code></pre> |
| 413 | + </div> | |
| 414 | + </div> | |
| 415 | + | |
| 416 | + <div class="mxch-card"> | |
| 417 | + <div class="mxch-card-header"> | |
| 418 | + <h3 class="mxch-card-title"><?php esc_html_e('Remove documents deleted in your source system', 'mxchat'); ?></h3> | |
| 419 | + </div> | |
| 420 | + <div class="mxch-card-body"> | |
| 421 | + <p class="mxch-field-description"><?php esc_html_e('When a file is deleted in SharePoint, Drive or your CMS, delete it here by the same source_url you pushed it with — otherwise the bot keeps answering from it. Up to 50 per call, and a URL that is already gone comes back as deleted:false instead of an error, so an automation can re-send the same batch safely.', 'mxchat'); ?></p> | |
| 422 | + <pre class="mxch-api-codeblock"><code>curl -X DELETE -H "Authorization: Bearer YOUR_TOKEN" \ | |
| 423 | + -H "Content-Type: application/json" \ | |
| 424 | + -d '{"source_url":["https://example.com/handbook.pdf","https://example.com/policy-2024.docx"]}' \ | |
| 425 | + "<?php echo esc_html($knowledge_url); ?>"</code></pre> | |
| 426 | + </div> | |
| 427 | + </div> | |
| 428 | + | |
| 429 | + <div class="mxch-card"> | |
| 430 | + <div class="mxch-card-header"> | |
| 431 | + <h3 class="mxch-card-title"><?php esc_html_e('Sync new leads into your CRM', 'mxchat'); ?></h3> | |
| 432 | + </div> | |
| 433 | + <div class="mxch-card-body"> | |
| 434 | + <p class="mxch-field-description"><?php esc_html_e('Poll incrementally by passing the timestamp of the last lead you imported.', 'mxchat'); ?></p> | |
| 435 | + <pre class="mxch-api-codeblock"><code>curl -H "Authorization: Bearer YOUR_TOKEN" \ | |
| 436 | + "<?php echo esc_html($leads_url); ?>?since=2026-05-01T00:00:00Z&per_page=200"</code></pre> | |
| 400 | 437 | </div> |
| 401 | 438 | </div> |
| 402 | 439 | |
| 403 | 440 | <div class="mxch-card"> |