Skip to content
Last updated

Topic Import

About Topics

The knowledge base typically houses information intended for both internal and external purposes. Within the repository of articles, some are exclusively designated for agent access, while others are suitable for customer viewing. Topics play a crucial role in determining which sections of the knowledge base are accessible on the portal.

Learn more about Topics


Organizing Topic Structure

  1. Organize Topics Sequentially: Ensure a clear and intuitive structure by arranging topics in a logical, sequential order.
  2. Add Subtopics as Needed: Enhance the overall organization by creating multiple subtopics within each topic. Make sure that subtopics follow the same logical sequence.
{
  "topics": [
    {
      "name": "Credit Card and Payments",
      "description": "",
      "addArticles": {
        "fromArticles": [
          {
            "path": "Purple Nile Retail - Sample Data/Credit Cards & Payments/E-Gift Cards"
          }
        ]
      }
    }
  ]
}

Creating Topics

  1. Access the Knowledge System: Log in to the Knowledge Console.
  2. Review the Topic Hierarchy: Take note of the existing topic structure to understand how the new topic fits into the overall organization.
  3. Set Up the Topic: Map the folder structure in a JSON format. Ensure to begin with a root element named "topics" that contains an array.
    {
      "topics": []
    }
  4. Add Each Topic: Add an object within the "topics" array containing the necessary details for the topics, such as its name, description, and addArticles object.
ParameterDescriptionTypeRequired
nameName of the topicStringYes
descriptionDescription of the topicStringOptional
addArticlesAn object that contains an array of articles to be added to the topicArrayYes
  1. Add Articles to the Topic: Within the "addArticles" object, create an array named "fromArticles" or "fromFolders". Each entry in this array should be an object that includes the "path" to the article/folder within the knowledge base.
ParameterDescriptionType
fromArticlesList of specific articles to be addedArray
fromArticles.pathPath of the article to include in the topicString
fromFoldersList of folders from which articles can be addedArray
fromFolders.pathPath of the folder to include in the topicString
  1. Repeat for Additional Topics: Continue adding each topic to the "topics" array, ensuring each entry follows the same format.
{
  "topics": [
    {
      "name": "Name of topic",
      "description": "",
      "addArticles": {
        "fromFolders": [
          {
            "path": "Folder Path"
          }
        ],
        "fromArticles": [
          {
            "path": "Article Path"
          }
        ]
      }
    },
    {
      "name": "Name of topic",
      "description": "",
      "addArticles": {
        "fromFolders": [
          {
            "path": "Folder Path"
          }
        ],
        "fromArticles": [
          {
            "path": "Article Path"
          }
        ]
      }
    }
  ]
}

Creating Subtopics

  1. Locate the parent topic: Navigate to the desired topic to add a subtopic.
  2. Set Up the Subtopic: Add the "topics" array within the parent topic object.
  3. Add Each Subtopic: Add an object within the nested "topics" array containing the necessary details, such as its name, description, and addArticles object.
ParameterDescriptionTypeRequired
nameName of the subtopicStringYes
descriptionDescription of the subtopicStringOptional
addArticlesAn object that contains an array of articles to be added to the subtopicArrayYes
  1. Add Articles to the Subtopic: Within the "addArticles" object, create an array named "fromArticles" or "fromFolders". Each entry in this array should be an object that includes the "path" to the article/folder within the knowledge base.
ParameterDescriptionType
fromArticlesList of specific articles to be addedArray
fromArticles.pathPath of the article to include in the subtopicString
fromFoldersList of folders from which articles can be addedArray
fromFolders.pathPath of the folder to include in the subtopicString
{
  "topics": [
    {
      "name": "Name of topic",
      "description": "",
      "addArticles": {
        "fromFolders": [
          {
            "path": "Folder Path"
          }
        ],
        "fromArticles": [
          {
            "path": "Article Path"
          }
        ]
      },
      "topics": [
        {
          "name": "Name of subtopic",
          "description": "",
          "addArticles": {
            "fromFolders": [
              {
                "path": "Folder Path"
              }
            ],
            "fromArticles": [
              {
                "path": "Article Path"
              }
            ]
          }
        }
      ]
    }
  ]
}

Resource Identifiers

The optional id and externalId fields provide precise control over how a topic is matched during import. These fields are especially useful for content synchronization, where relying on the topic name and path alone can create duplicate topics if the name or path changes in the source system.

Provide only one identifier per topic — either id or externalId, but not both. If both are supplied, the import validation aborts.

ParameterDescriptionTypeRequired
idThe internal eGain system ID of the topic. When provided, the import updates the specific topic matching this ID, overriding name/path matching. Readable IDs are not supported.StringOptional
externalIdA reference ID used to synchronize the topic with an external source topic ID. When provided, the import updates the topic previously mapped to this ID. If no topic is mapped to the externalId yet, you must also provide the topic name so a new topic can be created and linked to it.StringOptional

Matching Behavior:

IdentifierMatchAction Taken
id providedN/AUpdates the topic matching the provided id.
externalId providedMapped topic existsUpdates the topic mapped to the provided externalId.
externalId providedNo mapped topicCreates a new topic (requires name) and links it to the externalId.
Neither providedName/path match foundUpdates the existing topic matching the name/path (existing behavior).
Neither providedNo name/path matchCreates a new topic (existing behavior).
{
  "topics": [
    {
      "externalId": "sharepoint-topic-17",
      "name": "Name of topic",
      "description": "",
      "addArticles": {
        "fromArticles": [
          {
            "path": "Article Path"
          }
        ]
      }
    }
  ]
}