http
POST https://services.leadconnectorhq.com/knowledge-bases/faqsAuthorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
locationId | string | Yes | HqDZpF8GH3qvgJTmKCoL | account ID as string |
question | string | Yes | What is the capital of France? | faq question as a string |
answer | string | Yes | The capital of France is Paris. | faq answer as a string |
knowledgeBaseId | string | Yes | 710KoEzy793Fxubft0bc | knowledge base ID as string |
Responses
201 - FAQ created successfully
success(boolean, required): Success status of the operation Example:Truefaq(object, required): Created FAQ details
json
{
"success": true
}400 - Bad Request
statusCode(number): Example:400message(string): Example:Bad Request
json
{
"statusCode": 400,
"message": "Bad Request"
}422 - Unprocessable Entity
statusCode(number): Example:422message(string[])error(string): Example:Unprocessable Entity
json
{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}500 - Internal Server Error
statusCode(number): Example:500message(string): Example:Internal Server Error
json
{
"statusCode": 500,
"message": "Internal Server Error"
}Example
curl -X POST 'https://services.leadconnectorhq.com/knowledge-bases/faqs' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"locationId": "HqDZpF8GH3qvgJTmKCoL",
"question": "What is the capital of France?",
"answer": "The capital of France is Paris.",
"knowledgeBaseId": "710KoEzy793Fxubft0bc"
}'const response = await fetch('https://services.leadconnectorhq.com/knowledge-bases/faqs', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"locationId": "HqDZpF8GH3qvgJTmKCoL", "question": "What is the capital of France?", "answer": "The capital of France is Paris.", "knowledgeBaseId": "710KoEzy793Fxubft0bc"}),
});
const data = await response.json();import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/knowledge-bases/faqs',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"locationId": "HqDZpF8GH3qvgJTmKCoL", "question": "What is the capital of France?", "answer": "The capital of France is Paris.", "knowledgeBaseId": "710KoEzy793Fxubft0bc"},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/knowledge-bases/faqs');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'locationId': 'HqDZpF8GH3qvgJTmKCoL', 'question': 'What is the capital of France?', 'answer': 'The capital of France is Paris.', 'knowledgeBaseId': '710KoEzy793Fxubft0bc'}),
]);
$data = json_decode(curl_exec($ch), true);