Skip to content

Import Project Data

Request

Imports project data for a given projectId. Only Project Owner and Analyst can Import Project Data into a private project.
Try it out is not available for this API. This API can be tested using conventional REST API clients such as postman or cURL
When calling this API from a REST client, you need to run either of the curl commands.
Save the required attributes in a json or a text file for project import and provide that file in the command. If you are using text file, don't give .txt extension.

curl -H "Authorization:Bearer %jwt%" -F importFile=@"fileToImport.zip" -F projectImportModel=@"JsonFile.json Or textFile;type=application/json" http://localhost:8888/codeinsight/api/projects/%projectId%/import

Or else, instead of providing file, you can directly define the attributes for projectImportModel inside curly braces.
Provide 'FileMatchingCriteria' either of the below values:
COMPLETE_FILEPATH|PARTIAL_FILEPATH|FILENAME|MD5|MD5_AND_FILENAME|MD5_AND_COMPLETE_FILEPATH|MD5_AND_PARTIAL_FILEPATH

Security
bearerAuth
Path
projectIdinteger, (int32), >= 1required
Bodymultipart/form-data
File to importobject
Project Import Modelobject(ProjectImportModel)
curl -i -X POST \
  'https://codeinsightapi.redocly.app/_mock/swagger/projects/{projectId}/import' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: multipart/form-data' \
  -F 'File to import={}' \
  -F 'Project Import Model={"createEmptyInventory":false,"overwriteInventoryNotes":true,"addFilesToInventory":true,"inventoryFileMatchingCriteria":"COMPLETE_FILEPATH","inventoryDirectoryDepth":1,"markFilesAsReviewed":true,"reviewFileMatchingCriteria":"MD5_AND_COMPLETE_FILEPATH","reviewDirectoryDepth":1,"resetInventoryUsage":true}'

Responses

OK