FTOS_CB_AddUpdateContractDocument
Adds or updates a contract document record. The set of parameters sent via the request body determines the operation performed at the database level.
Syntax
The FTOS_CB_AddUpdateContractDocument custom endpoint is called from within the Endpoint API endpoint. Visit the Endpoint API page for more details.
POST <host_address>/ftosapi/automation-processors/actions/FTOS_CB_AddUpdateContractDocument
Content-Type: application/json
{
"contractName":"<contract_number>",
"documentName":"<document_name_Only_for_Updates>",
"documentType":"<document_type>",
"status":"",
"description":"<document_description>",
"fileName":"<file_name_with_extension_.pdf,.doc,.docx,.els,.jpg,.jpeg,.xlsx,.dll,.ppt,.pptx,.txt,.png,.ttf,.xml>",
"number":"<external_document_identifier_number>",
"document":"<file_converted_to_base64>",
"documentSigned":"<signed_document_file_converted_to_base64>",
"fileNameSigned":"<signed_document_file_name_with_extension_.pdf,.doc,.docx,.els,.jpg,.jpeg,.xlsx,.dll,.ppt,.pptx,.txt,.png,.ttf,.xml>"
}
Here's a list of the available parameters:
| Parameter | Description |
|---|---|
| host_address | URL of the FintechOS Platform server. |
| contractName | Mandatory, string. The contract to which the document is added. |
| documentType | Mandatory, string. The type of the document. Possible options from option set: FTOS_BNKAP_DocumentType. |
| documentName | Mandatory update requests, string. The name of the document. If you send this parameter, then Loan Management performs an update of the record with this document name. |
| status | String. The status of the document record. |
| description | String. The description of the document. |
| fileName | String. The name of the file containing the original document. |
| number | String. An external identifier number of the document, if needed. |
| document | File. The file containing the original document, converted to base64. |
| documentSigned | Mandatory only if the document record's status should change to Signed, file. The file containing the signed document, converted to base64. |
| fileNameSigned | Mandatory only if the document record's status should change to Signed, string. The name of the file containing the signed document. |
Response
The response indicates the result of the code execution, specifically the result of creating or updating a document record, along with the document name documentName.
Example
To create a new contract document record, the parameters should not identify a contract document already in the system. If the request also contains values for DocumentSigned and FileNameSigned, then the document's status changes to Signed.
Request
POST https://FintechOSStudio/ftosapi/automation-processors/actions/FTOS_CB_AddUpdateContractDocument
Content-Type: application/json
{
"contractName": "6586",
"documentName": "",
"documentType": "BI/CI",
"status": "",
"description": "Testt Description",
"fileName": "rand.txt",
"number": "1234",
"document": "UmFuZCB0eHQ=",
"documentSigned": "",
"fileNameSigned": ""
}
Response
{
"DocumentName": "6586 - BI/CI - 130"
}
To update an existing record, send the request used for adding the document, this time mentioning the DocumentName parameter with the value returned by the add request. If the request also contains values for DocumentSigned and FileNameSigned, then the document's status changes to Signed.
Request
POST https://FintechOSStudio/ftosapi/automation-processors/actions/FTOS_CB_AddUpdateContractDocument
Content-Type: application/json
{
"contractName": "6586",
"documentName": "6586 - BI/CI - 130",
"documentType": "BI/CI",
"status": "",
"description": "Testt Description",
"fileName": "rand.txt",
"number": "2000",
"document": "UmFuZCB0eHQ=",
"fileNameSigned": "rand_SIGNED.txt",
"documentSigned": "UmFuZCB0eHQ="
}
Response
{
"DocumentName": "6586 - BI/CI - 130"
}