Upload Custom Knowledge Files to Knowledge Hub

You can add files to a knowledge base in Knowledge Hub via APIClosed Application Programming Interface. Allows you to automate certain functionality by connecting your CXone Mpower system with other software.. This allows you to populate the knowledge base with files from a custom knowledge sourceClosed A website that stores troubleshooting articles.. This means you can use Knowledge Hub even if you do not use a supported knowledge source. You can then configure Copilot for Agents to use your custom knowledge files to generate content.

This method is a developer effort. It requires knowledge of REST APIs and programming ability to send files using an API.

Please note:

  • The maximum file size of an individual file is 50 MB.

  • You can transfer up to 100 files at a time.

Complete each of these tasks in the order given.

Configure the Knowledge Base

Follow the steps below to configure the knowledge base in Knowledge Hub to use a custom knowledge source. This generates the necessary IDs for the knowledge base that you must include in the API call that transfers files.

If you do not yet have a knowledge base, contact NICE Professional Services. Only NICE Professional Services can create new knowledge bases.

  1. In CXone Mpower, click the app selector and select Admin > GenAI ManagerKnowledge Hub.

  2. Click on the knowledge base you want to add a custom knowledge source to.

  3. In the Knowledge Base Source drop-down, select Custom.

  4. Click Submit.

Get an Access Token

To use the Knowledge Hub API, you must include an access token in the header of your call. To get an access token, you must exchange certain credentials provided by NICE. Follow the Getting Started instructions on the developer portal to do so. Later, you should include this access token in your API call. It lets CXone Mpower know that the call is not fraudulent.

You can read more details about API authentication and authorization in CXone Mpower .

Fetch IDs

To transfer files with the Knowledge Hub API, you must include two IDs:

  • Data Source ID: Unique ID string for the custom knowledge source. This tells the API where to pull content from.

  • Knowledge Hub ID: Unique ID string for the knowledge base you configured. This tells the API where to push content to.

You can get both of these by calling the GET /knowledgehub API:

  1. Call the https://api-na1.niceincontact.com/eai-knowledge-hub-services/config/v1/knowledgehub API. You may need to replace na1 in that URL; it should match what comes before nice-incontact.com in your CXone Mpower URL. Be sure to include your access token.

  2. In the response, find the Knowledge Hub ID in the id attribute of the knowledgeBases array.

  3. Find the data source ID in the id attribute of the dataSources array.

Push Files with the Knowledge Hub API

You can push up to 100 files to Knowledge Hub at a time. The maximum size per file is 50 MB.

Create a script that uses the POST /documents API to push files to Knowledge Hub. You can write this script in the language of your choice, such as Python, C#, or Java. You can use this sample Python script as a template. Set up the script to automatically run on a schedule to update Knowledge Hub with the latest content in your custom knowledge source.

Enter the IDs you fetched in the previous step as string parameters in the request body of the POST /documents API call.

  1. Sign in to the DEVone Developer Community using your CXone Mpower credentials.

  2. Navigate to the page for POST /documents.

  3. Click Try it out.

  4. Edit these values in the documents array:

    1. In clientToken, enter the access token you received during authentication.

    2. In dataSourceId, enter your data source ID.

    3. In knowledgeHubId, enter your Knowledge Hub ID.

  5. Copy the configured JSON into your script.

Your custom knowledge is then sent to Knowledge Hub. Knowledge Hub ingests and parses it for LLMClosed Large Language Model. A type of AI that processes, understands, and generates human language based on context. usage. It is displayed as a knowledge source under the knowledge base you configured.