To update the FAQs in bulk based on the combination of FAQ path and primary questions or by referenceId.

To use this API, the app needs the Bot Builder API scope of Update FAQs OR the Admin API Scope of Update FAQs.

POST https://{{host}}/api/public/bot/{{BotID}}/faqs/bulkupdates and https://{{host}}/api/public/faqs/bulkUpdates for Admin Console.

Path Parameters

Parameter Required/Optional Description
host Required Environment URL, for example, https://bots.kore.ai
BotID Required Bot ID or Stream ID. You can access it from the General Settings page of the bot.

Note: This is required only for Bot Builder API scope of Update FAQs.

Body Parameters

Parameter Required/Optional Description
faqPath Required The full path in the graph where the FAQ is added

Note: To retrieve FAQ questions, you need to either provide the faqPath or referenceId

referenceId Required Reference ID associated with the FAQ.

Note: TTo retrieve FAQ questions, you need to either provide the faqPath or referenceId.

language Required The bot language, for example, “en” for English, “de” for German etc.,
primaryQuestion Required The primary question for which the FAQ is to be updated

Note:To update FAQ, it should either have primaryResponse or extendedResponses or alternateResponses or faqStatus.

BotID Required Bot ID or Stream ID. You can access it from the General Settings page of the bot.

Note:This body parameter is required only for Admin API scope of Update FAQs.
.

primaryResponse.text Required
primaryResponse.type Required
primaryResponse.channel Required

Authorization

Invoke the API with JWT in the header with the following syntax:

auth: {{JWT}}

Response Content Type

application/json

Sample Request

Bot Builder API request:

curl -X GET \
'https://{{host}}/api/public/faqs/bulkupdates'\
-H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
-H 'content-type: application/json' \
{
    "payload": [
        {
            "query": {
                "language": "en",
                "faqPath":"Covid Cases",
                "primaryQuestion":"Where can we test?"
            },
            "updateSet": {
                "primaryResponse": {
                    "text": "Cases are 18000 primary",
                    "type": "basic",
                    "channel": "default"
                }
             }
        }
    ]
}

Admin Console API request:

curl -X GET \
'https://{{host}}/api/public/bot/{{bot_id}}/faqs/bulkupdates' \
-H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
-H 'content-type: application/json' \

{
  payload: [
    {
      query: {
        language: "en",
        botId : “st-xxxx”,
        referenceId: "referenceIdofFAQ",
        faqPath: "node1-node2-node3",
        primaryQuestion: "primaryquestion",
        
      },
      updateSet: {
        "primaryResponse": {
          "text": "Will I get a confirmation of my registration?",
          "type": "basic",
          "channel": "default"
        },
        extendedResponses: [
          {
            "text": "ext1"
          },
          {
            "text": "ext2”
          }
        ],
        alternateResponses: [
          {
            "text": "alt1",
            "type": "basic",
            "channel": "default"
          },
          {
            "text": "alt2",
            "type": "basic",
            "channel": "default"
          }
        ],
        faqStatus: true
      }
    },
    {
      query: {
        language: "en",
        botId : “st-xxxx”,
        referenceId: "referenceIdofFAQ",
        faqPath: "node1-node2-node3",
        primaryQuestion: "primaryquestion",
        
      },
      updateSet: {
        "primaryResponse": {
          "text": "Will I get a confirmation of my registration?",
          "type": "basic",
          "channel": "default"
        },
        extendedResponses: [
          {
            "text": "ext1"
          },
          {
            "text": "ext2"
          }
        ],
        alternateResponses: [
          {
            "text": "alt1",
            "type": "basic",
            "channel": "default"
          },
          {
            "text": "alt2",
            "type": "basic",
            "channel": "default"
          }
        ],
        faqStatus: true
      }
    }
  ]
}

Sample Response

For primary response

[
    {
        "query": {
                 "language": "en",
                "faqPath":"Covid Cases",
                "primaryQuestion":"Where can we test?"
        },
        "botId": "st-2937822d-683e-5737-8a5f-909a9abf7504",
        "response": "successfully updated"
    }
]

For activating FAQs

Request:

{
    "payload": [
        {
            "query": {
                "language": "en",
                "referenceId":"Covid123"
            },
            "updateSet": {
               "faqStatus" : true
             }
        }
    ]
}

Response

[
    {
        "query": {
                "language": "en",
                "referenceId":"Covid123"
        },
        "botId": "st-2937822d-683e-5737-8a5f-909a9abf7504",
        "response": "successfully updated"
    }
]

For deactivating FAQs

request

{
    "payload": [
        {
            "query": {
                "language": "en",
                "faqPath":"Covid Cases",
                "primaryQuestion":"Where can we test?"
            },
            "updateSet": {
               "faqStatus" : false
             }
        }
    ]
}

Response

[
    {
        "query": {
                 "language": "en",
                "faqPath":"Covid Cases",
                "primaryQuestion":"Where can we test?"
        },
        "botId": "st-2937822d-683e-5737-8a5f-909a9abf7504",
        "response": "successfully updated"
    }
]

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed