Imports new content into an existing project.
POST projects/{project-id}/?action=import&format={formatType}
Authentication
This request requires basic authentication.
Request Parameters
Path params
|
project-id |
string
|
The ID of the project to import a file to. |
|---|
Query params
|
action
|
string
|
Action to perform. Only import is supported. |
|---|---|---|
|
format
|
string
|
Specifies how the import data is provided. Can be url or base64. |
Body params
| importFormat |
string
|
Import format. Supported values: Word, Rtf, Epub, Odt, Html, Markdown, ProjectBackup, Docfx, AutoDocs.
|
|---|---|---|
|
inputFileContent
|
string
|
[optional] Base64-encoded content of the file to import. Required if base64 is selected for the format query parameter. If url format is selected, this parameter is ignored.
|
|
inputFileName
|
string
|
[optional] The name of the file with an extension. Required if base64 is selected for the format query parameter. If url format is selected, this parameter is ignored. |
|
inputFileUrl
|
string
|
[optional] The URL of the file. It can be a public URL (no authentication required) or a path to a file in ClickHelp Storage. Required if url is selected for the format query parameter. If base64 format is selected, this parameter is ignored. |
|
options
|
object
|
Additional import parameters. |
|
__type
|
string
|
The type of the import options. Allowed types for the formats:
|
|
isDownloadExternalLinkedFiles
|
bool
|
[optional] Whether or not to download files linked from your content. Set to False by default. Available for these formats: Word, Rtf, Epub, Odt, Html, Markdown, ProjectBackup, Docfx. |
| isDownloadExternalLinkedImages
|
bool
|
[optional] Whether or not to download images linked from your content. Set to True by default. Available for these formats: Word, Rtf, Epub, Odt, Html, Markdown, ProjectBackup, Docfx. |
|
tocGenerationType
|
string
|
[optional] Defines how the imported document will be split into topics. Acceptable values for Word, Rtf, Epub, Odtformats: UseStyleOutline, UseParagraphOutline, UseTcFields, ImportAsSingleTopic. Set to UseStyleOutline by default. Acceptable values for Htmland Markdown formats: UseParagraphOutline and ImportAsSingleTopic. Set to ImportAsSingleTopic by default. |
|
maxTocOutlineLevel
|
string
|
[optional] The maximum TOC depth for the imported file. Set to 2 by default. Available for these formats: Word, Rtf, Epub, Odt. |
|
stylesProcessingType
|
string
|
[optional] Configuration of how ClickHelp should handle the styles. Acceptable values: KeepPreciseStyles , OptimizeStyles , DoNotImportStyles. Set to OptimizeStyles by default. Available for these formats: Word, Rtf, Epub, Odt, Html, Markdown. |
|
imageFormat
|
string
|
[optional] The desired format for image files: Png or Jpeg. Set to Png by default. Available for these formats: Word, Rtf, Epub, Odt. |
|
splitModeType
|
string
|
[optional] Import mode for the AutoDocs format: GroupMethods, SeparateTopics or SingleTopic. |
| updatedMountPointTocNodeId | string | [optional] The ID of a TOC mount point node that should be updated. This ID corresponds to tocNodeId that can be gotten using the Get Topic method. |
Samples
Request samples
AutoDocs
Bash (Unix Shell) |
[Bash (Unix Shell)] curl --location --request POST 'https://{portal-url}/api/v1/projects/api-project/?action=import&format=url' \ --data-raw '{ "importFormat": "AutoDocs", "inputFileUrl": "https://petstore.swagger.io/v2/swagger.json", "options": { "__type": "AutoDocsImportOptions", "splitModeType": "SeparateTopics", "updatedMountPointTocNodeId": "cf57d4a1-f4c1-48e7-8637-2d8270a0fc9b" } }' |
Word
Bash (Unix Shell) |
[Bash (Unix Shell)] curl --location --request POST 'https://{portal-url}/api/v1/projects/my-project/?action=import&format=url' \ --data-raw '{ "importFormat": "Word", "inputFileUrl": "https://myportal.clickhelp.co/resources/Storage/import-sample.docx", "options": { "__type": "WordImportOptions", "isDownloadExternalLinkedFiles": false, "isDownloadExternalLinkedImages": true, "tocGenerationType": "UseStyleOutline", "maxTocOutlineLevel": 2, "stylesProcessingType": "OptimizeStyles", "imageFormat": "Png" } }' |
Rtf
Bash (Unix Shell) |
[Bash (Unix Shell)] curl --location --request POST 'https://{portal-url}/api/v1/projects/my-project/?action=import&format=url' \ --data-raw '{ "importFormat": "Rtf", "inputFileUrl": "https://myportal.clickhelp.co/resources/Storage/import-sample.rtf", "options": { "__type": "RtfImportOptions", "isDownloadExternalLinkedFiles": false, "isDownloadExternalLinkedImages": true, "tocGenerationType": "UseStyleOutline", "maxTocOutlineLevel": 2, "stylesProcessingType": "KeepPreciseStyles", "imageFormat": "Jpeg" } }' |
Epub
Bash (Unix Shell) |
[Bash (Unix Shell)] curl --location --request POST 'https://{portal-url}/api/v1/projects/my-project/?action=import&format=url' \ --data-raw '{ "importFormat": "Epub", "inputFileUrl": "https://myportal.clickhelp.co/resources/Storage/import-sample.epub", "options": { "__type": "EpubImportOptions", "isDownloadExternalLinkedFiles": false, "isDownloadExternalLinkedImages": true, "tocGenerationType": "UseStyleOutline", "maxTocOutlineLevel": 3, "stylesProcessingType": "DoNotImportStyles", "imageFormat": "Png" } }' |
Odt
Bash (Unix Shell) |
[Bash (Unix Shell)] curl --location --request POST 'https://{portal-url}/api/v1/projects/my-project/?action=import&format=url' \ --data-raw '{ "importFormat": "Odt", "inputFileUrl": "https://myportal.clickhelp.co/resources/Storage/import-sample.odt", "options": { "__type": "OdtImportOptions", "isDownloadExternalLinkedFiles": false, "isDownloadExternalLinkedImages": true, "tocGenerationType": "UseStyleOutline", "maxTocOutlineLevel": 3, "stylesProcessingType": "OptimizeStyles", "imageFormat": "Png" } }' |
Html
Bash (Unix Shell) |
[Bash (Unix Shell)] curl --location --request POST 'https://{portal-url}/api/v1/projects/my-project/?action=import&format=url' \ --data-raw '{ "importFormat": "Html", "inputFileUrl": "https://myportal.clickhelp.co/resources/Storage/import-sample.zip", "options": { "__type": "HtmlImportOptions", "isDownloadExternalLinkedFiles": false, "isDownloadExternalLinkedImages": true, "tocGenerationType": "ImportAsSingleTopic", "stylesProcessingType": "OptimizeStyles" } }' |
Markdown
Bash (Unix Shell) |
[Bash (Unix Shell)] curl --location --request POST 'https://{portal-url}/api/v1/projects/my-project/?action=import&format=url' \ --data-raw '{ "importFormat": "Markdown", "inputFileUrl": "https://myportal.clickhelp.co/resources/Storage/import-sample.zip", "options": { "__type": "MarkdownImportOptions", "isDownloadExternalLinkedFiles": false, "isDownloadExternalLinkedImages": true, "tocGenerationType": "ImportAsSingleTopic", "stylesProcessingType": "KeepPreciseStyles" } }' |
ProjectBackup
Bash (Unix Shell) |
[Bash (Unix Shell)] curl --location --request POST 'https://{portal-url}/api/v1/projects/my-project/?action=import&format=url' \ --data-raw '{ "importFormat": "ProjectBackup", "inputFileUrl": "https://myportal.clickhelp.co/resources/Storage/project-backup.zip", "options": { "__type": "ProjectBackupImportOptions", "isDownloadExternalLinkedFiles": false, "isDownloadExternalLinkedImages": true } }' |
Docfx
Bash (Unix Shell) |
[Bash (Unix Shell)] curl --location --request POST 'https://{portal-url}/api/v1/projects/my-project/?action=import&format=url' \ --data-raw '{ "importFormat": "Docfx", "inputFileUrl": "https://myportal.clickhelp.co/resources/Storage/import-sample.zip", "options": { "__type": "DocfxBackupImportOptions", "isDownloadExternalLinkedFiles": false, "isDownloadExternalLinkedImages": true } }' |
Response sample
JSON |
[JSON] { "taskKey": "24685f07c1644b12add45da9df56ed6c" } |
Response fields
|
taskKey
|
The task key of the import process. |
|---|