How to Import Documents to Knowledge Base via API

 

This help article provides information on how to update existing files or upload new files to the Knowledge Base using the ProProfs API. This feature is currently in beta and supports replacing existing files if they already exist.

 

Prerequisites:

 

To use this API, you need:

 

  • Your private API key
  • Basic knowledge of making HTTP requests

 

Your private API key is required for authentication. You can find your API key by navigating to Settings > In-App Help > API key

 

Endpoint URL: https://www.helpdocsonline.com/proprofsapi/replacefile

Request Method: POST

Request Format: Multipart form data

 

 

Endpoint URL: https://www.helpdocsonline.com/proprofsapi/getfiles

 

Request Method: GET

 

Request Format: JSON

 

URL Parameters

 

Name

Required

Type

Description

api_key

Yes

String

Your private API key for the FAQ.

 

The API key is available at:

Settings > In-App Help > API key


 

Example Request

 

POST https://www.helpdocsonline.com/proprofsapi/getfiles

Accept: application/json

Content-Type: application/json

{  

    "api_key": "Your Private API Key",

}

 

Response Format

JSON

 

Response Fields

 

Name

Required

file_path

Path of the file. This path will use while replacing a file on the same path.

file_url

Full URL of the file

last_updated

Last updated time of the file


 

Response Example

 

Content-Type: application/json

[

 {

        "file_path": "userfiles/2652/4069/ckfinder/files/",

        "file_url": "https://dzf8vqv24eqhg.cloudfront.net/userfiles/2652/4069/ckfinder/files/",

        "last_updated": "2019-03-25T12:19:32+0000"

    },

    {

        "file_path": "userfiles/2652/4069/ckfinder/files/---Advanced Templates for Ext JS.mp4",

        "file_url": "https://dzf8vqv24eqhg.cloudfront.net/userfiles/2652/4069/ckfinder/files/---Advanced Templates for Ext JS.mp4",

        "last_updated": "2017-07-19T10:23:08+0000"

    }

]

 

To Update Existing Files or Upload a New File (Beta)

 

The API will help you upload a file. If the file already exists, it will replace the existing file.

Maximum size of file is 100 MB

 

Endpoint URL: https://www.helpdocsonline.com/proprofsapi/replacefile

 

Request Method POST

 

Request Format Multipart form data

 

URL Parameters

 

Name

Required

Type

Description

token

Yes

Json

Json data combining of API key, file path, file name, content type, topic_id and table_id,download_id, subject, last_modified_date

data-binary

Yes

File

Rich text document / media

 

"token" fields should be in JSON format

api_key - API key of the FAQ

file_path - Path of the File. We can collect File path from getfile API. This is mandatory because we are offering folders within file section.

file_name - The Name of the file 

Content_Type - Type of the content that is being uploaded. 

topic_id = What page you  are looking to add new row. (Not required)

table _id = ID of the table body (tbody)  where new row will append. (Not required)

download_id = Download ID required when adding a row to table.

subject = Subject is required when we adding a new row to table.

last_modified_date = Last modified date is also required when adding a row to table.

 

Table structure is fixed with five rows

 

Example Request

 

POST: https://www.helpdocsonline.com/proprofsapi/replacefile

Accept: multipart/form-data

Content-Type: multipart/form-data

 

Token =

[  
   {  
      "key":"token",
      "value":"{\"api_key\":\"5ed023beb79748bda8bd2eb1d7947c9f0ef20b5d7d8c\",\"file_name\":\"proprofs.txt\",\"file_path\":\"folder1/proprofs.txt\",\"Content_Type\":\"text/html\"}",
      "description":"",
      "type":"text",
      "enabled":true
   }
]

 

data-binary = File type to be post

HTML form example

<input type=”file” name=”data-binary”>



 

Response Format

 

JSON

 

Response Fields

 

Name

Required

status

Success / Failed 

file_url

Full URL of uploaded file.


 

Response Example

 

Content-Type: application/json

{

"status": "Success",

"file_url": " URL of the File"

}

Was this information helpful?
© 2005 - 2024 ProProfs
-
add chat to your website