Skip to main content
DELETE https://services.leadconnectorhq.com/knowledge-bases/crawler

Autorización

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.

Body

knowledgeBaseId
string
default:"tDtDnQdgm2LXpyiqYvZ6"
required
knowledge base ID as string
locationId
string
default:"tDtDnQdgm2LXpyiqYvZ6"
required
account ID as string
urlIds
string[]
default:"[tDtDnQdgm2LXpyiqYvZ6]"
required
List of trained urls ids ( fetched from the Get all trained page links by knowledge base endpoint)

Respuestas

success
boolean
default:"True"
required
Indicates if the operation was successful
{
  "success": true
}
statusCode
number
default:"400"
message
string
default:"Bad Request"
{
  "statusCode": 400,
  "message": "Bad Request"
}
statusCode
number
default:"401"
message
string
default:"Invalid token: access token is invalid"
error
string
default:"Unauthorized"
{
  "statusCode": 401,
  "message": "Invalid token: access token is invalid",
  "error": "Unauthorized"
}
statusCode
number
default:"422"
message
string[]
error
string
default:"Unprocessable Entity"
{
  "statusCode": 422,
  "message": [
    "Unprocessable Entity"
  ],
  "error": "Unprocessable Entity"
}
statusCode
number
default:"500"
message
string
default:"Internal Server Error"
{
  "statusCode": 500,
  "message": "Internal Server Error"
}

Ejemplo

curl -X DELETE 'https://services.leadconnectorhq.com/knowledge-bases/crawler' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "knowledgeBaseId": "tDtDnQdgm2LXpyiqYvZ6",
  "locationId": "tDtDnQdgm2LXpyiqYvZ6",
  "urlIds": "[tDtDnQdgm2LXpyiqYvZ6]"
}'
const response = await fetch('https://services.leadconnectorhq.com/knowledge-bases/crawler', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
    Version: '2021-07-28',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"knowledgeBaseId": "tDtDnQdgm2LXpyiqYvZ6", "locationId": "tDtDnQdgm2LXpyiqYvZ6", "urlIds": "[tDtDnQdgm2LXpyiqYvZ6]"}),
});
const data = await response.json();
import os, requests
response = requests.request(
    'DELETE',
    'https://services.leadconnectorhq.com/knowledge-bases/crawler',
    headers={
        'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
        'Version': '2021-07-28',
        'Content-Type': 'application/json',
    },
    json={"knowledgeBaseId": "tDtDnQdgm2LXpyiqYvZ6", "locationId": "tDtDnQdgm2LXpyiqYvZ6", "urlIds": "[tDtDnQdgm2LXpyiqYvZ6]"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/knowledge-bases/crawler');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
        'Version: 2021-07-28',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode({'knowledgeBaseId': 'tDtDnQdgm2LXpyiqYvZ6', 'locationId': 'tDtDnQdgm2LXpyiqYvZ6', 'urlIds': '[tDtDnQdgm2LXpyiqYvZ6]'}),
]);
$data = json_decode(curl_exec($ch), true);