Import Library Documents
Creates a job to import documents from the library. The Import Document to Library job imports the content from a local source to the library in the specified upload location. Using REST APIs allows you to automate the tasks of uploading library artifacts.
Using this REST API requires prerequisites, such as understanding how to use jobs. See Prerequisites. Be sure that you understand how to use jobs as described in Managing Jobs. For additional details, see Job Types.
Before using the REST resources, you must understand how to access the REST resources and other important concepts. See Implementation Best Practices for Cloud EPM REST APIs.
Required Roles
Service Administrator
Request
Supported Media Types: application/json
Parameters
The following table summarizes the client request parameters specific to this job. For additional parameters that are common to all jobs, see Execute a Job.
Table 8-37 Parameters
Name | Description | Required | Default |
---|---|---|---|
jobType |
Import Document to Library or IMPORT_DOCUMENT_TO_LIBRARY | Yes | None |
jobName |
The name of this job. Example: Import_Annual_Report | No | Import Document to Library |
name |
The name of the document or ZIP file containing documents being imported. | Yes | |
description |
Brief description of the document being imported. For ZIP files, this description applies to all documents within it. | Yes | None |
idOrFullyQualifiedDestinationPath |
The library destination path where the document(s) will be imported. This can be a path with folders or UUID of the folder. |
Yes | None |
overwrite |
If a file with the same name exists in the default download location, the file will not be overwritten by default unless the overwrite flag is passed as true .
|
No | false |
deleteAfterImport |
Determines whether the file should be deleted from the local source after import. For imports using a ZIP file, the source file will be deleted only if all contained documents are imported successfully. |
No | false |
errorFile |
The error file name, in the default download location, which contains the details (including errors) of the operation. Any existing error file with the same name is overwritten. If you don’t provide the extension in Use the Inbox/Outbox Explorer to view the details of the error file. Use the Download REST API to download the file. |
No | None |
For a sample URL, see Sample URL and Payload in Execute a Job.
Sample Payload Example
Imports a document called FinancialReport2022.xlsx
into a folder
called Insights
with a description. If a file with the same name
exists, it will be overwritten. An error file named
FinancialReport2022ImportLog.log
will be created with details
of the activity.
{
"jobType": "IMPORT_DOCUMENT_TO_LIBRARY",
"jobName": "ImportSingleDocument",
"parameters": {
"name": "FinancialReport2022.xlsx",
"description": "Annual Financial Report for 2022",
"idOrFullyQualifiedDestinationPath": "Library/Insights",
"overwrite": true,
"deleteAfterImport": false,
"errorFile": "FinancialReport2022ImportLog.log"
}
}
Sample Payload Example: Importing a ZIP File
Imports a ZIP file named Reports2022.zip
into the folder
Reports
. The import process generates a common log file,
Reports2022ImportLog.log
, which aggregates the details and
outcomes of all child jobs associated with the documents contained within the
Reports2022.zip
file.
{
"jobType": "IMPORT_DOCUMENT_TO_LIBRARY",
"jobName": "ImportMultipleDocuments",
"parameters": {
"name": "Reports2022.zip",
"description": "Collection of Financial Reports for 2022",
"idOrFullyQualifiedDestinationPath": "Library/Reports",
"overwrite": true,
"deleteAfterImport": false,
"errorFile": "Reports2022ImportLog.log"
}
}