Imports a Swagger/OpenAPI definition to 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 an API definition to. |
|---|
Query params
|
action
|
string
|
Action to perform. Only import is supported. |
|---|---|---|
|
format
|
string
|
Format of Swagger/OpenAPI definition. Can be url or base64. |
Body params
| importFormat |
string
|
Import format. Only AutoDocs is supported.
|
|---|---|---|
|
inputFileName
|
string
|
[optional] The name of the Swagger/OpenAPI definition file with an extension.
Required if base64 is selected for the format query parameter. If url format is selected, this parameter is ignored. |
|
inputFileContent
|
string
|
[optional] The content of the Swagger/OpenAPI definition file in the base64 format.
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 Swagger/OpenAPI definition file.
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. For the AutoDocs format, only AutoDocsImportOptions is allowed. |
|
splitModeType
|
string
|
Import mode: 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. If specified, all the topics of this mount point are updated. |
Samples
Request sample
Bash (Unix Shell) |
curl --location --request POST 'https://{portal-url}/api/v1/projects/api-project/?action=import&format=url' \ |
Response sample
JSON |
{ |
Response fields
|
taskKey
|
The task key of the import process. |
|---|