POST /import Import
importLoans
Import loans from client's environment
Boarding supports the import of loan documents from Google Cloud storage and SFTP. Boarding expects your loans to be organized in a
certain way. All documents in a loan should be in the same folder, a loan folder. The loan folder's name will be used as a loan identifier. All the loan folders should be in the same parent folder.
If you are going to import unclassified loans, set "import_classified_documents" to false. Then, the only required field is "loan_file_path" which maps the path for the loans.
Show the rest
If you are going to import classified loans, set "import_classified_documents" to true. Then, the import request body must specify the mapping for loan documents. All mapping files should be in the same folder, a mapping folder. The mapping folder and loan folder should be in the same parent folder. The mapping folder should contain CSV files that describe the document types and document paths (with respect to loan folder mentioned above). Also, as part of the import request body, it provides the document type mapping language for converting given document types to Staircase document types. User can create own language from here: Language Product This language should contain 1-1 mapping between user document type and Staircase document type.
In Google Cloud platform type; there is an additional field called loan_ids. With this field; user can specify the loan ids that needs to imported in loan file path.
This API supports using batch configuration. Instead of inputting all required information; you can input "batch_id" and it will use the import configuration that given batch contains. Note that batch configuration will override the other input. Batch configuration can be created from here: Create Batch
The API will return an execution id for successful requests. To see the results use Get Operation Result
Request
{
"platform": "google_cloud",
"batch_info": {
"import_classified_documents": true,
"bucket_name": "test_bucket_staircase",
"loan_file_path": "f2022-04-12/initial_onboarding_docs",
"document_type_file_path": "f2022-04-12/output_docs/onboarding_input_document_tag_files",
"document_type_mapping_language": "doctype_to_staircase"
}
} {
"platform": "google_cloud",
"batch_info": {
"import_classified_documents": true,
"bucket_name": "test_bucket_staircase",
"loan_file_path": "f2022-04-12/initial_onboarding_docs",
"document_type_file_path": "f2022-04-12/output_docs/onboarding_input_document_tag_files",
"document_type_mapping_language": "doctype_to_staircase",
"loan_ids": [
1001,
1002,
1003
]
}
} {
"platform": "google_drive",
"batch_info": {
"import_classified_documents": true,
"folder_name": "test_folder",
"loan_file_path": "loans",
"document_type_file_path": "mappings",
"document_type_mapping_language": "doctype_to_staircase"
}
} {
"platform": "sftp",
"batch_info": {
"import_classified_documents": true,
"user_name": "user",
"loan_file_path": "example_batch_folder/loan_folder",
"document_type_file_path": "example_batch_folder/mapping_folder",
"document_type_mapping_language": "doctype_to_staircase"
}
} {
"platform": "sftp_client",
"batch_info": {
"import_classified_documents": false,
"loan_file_path": "example_batch_folder/loan_folder",
"sftp_url": "sftp_server_url",
"sftp_user_name": "sftp_user_name",
"sftp_password": "sftp_password",
"folder_name": "folder_name"
}
} {
"batch_id": "01G3BC9MPZH4M0XQ45X6D1EA2V"
} Response
Successfully returned status of import request
{
"code": 200,
"message": {
"execution_id": "01G3BC9MPZH4M0XQ45X6D1EA2V"
}
} Request data failed validation
{
"code": 400,
"message": "Bad Request"
} Unprocessed Entity
{
"code": 422,
"message": "Unprocessed Entity."
} Parameters
1
| Parameter | Type | Example | Description |
|---|---|---|---|
x-api-key required | string header | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | Environment API Key. |
Request bodyapplication/json
3 fields
application/json| Field | Type | Description |
|---|---|---|
platform | string | The platform where the loan documents existgoogle_cloudgoogle_drivesftpsftp_client |
batch_info | object | Information needed to import batch |
bucket_name | string | Google Cloud storage bucket name |
loan_file_path | string | The path of the folder that contains loan folders |
doc_type_file_path | string | The path of the folder that contains mapping files in CSV format |
loan_ids | string[] | If you only want to import specific loan ids, you can filter out rest of them with using this field |
Response 200application/json
2 fields
200application/jsonSuccessfully returned status of import request
| Field | Type | Description |
|---|---|---|
code | string | Status code |
message | object | message |
execution_id | string | Execution id of the operation |
Response 400application/json
1 fields
400application/jsonRequest data failed validation
| Field | Type | Description |
|---|---|---|
error | object | Unprocessed entity error. |
coderequired | string | Error name. |
messagerequired | string | Error description. |
Response 422application/json
1 fields
422application/jsonUnprocessed Entity
| Field | Type | Description |
|---|---|---|
error | object | Unprocessed entity error. |
coderequired | string | Error name. |
messagerequired | string | Error description. |