API Bulk Upload

Calling the API

To use this API, a registered token and URL is required to make requests. If you want to know how to get your own API Token please contact us at [email protected] and we will provide it to you.

Please refer to <<https://relativity6-docs.readme.io/docs/rest-api-native-connection>> to learn how to call our api.

Upload file from API

To start, make an HTTP Post call to the following URL:

https://api.usemarvin.ai/naics/naics/external/upload
NameTypeDescription
descriptionStringOptional. Annotations for user consideration.
fileFileRequired. The CSV file to upload.
tokenStringRequired. The API token provided by Relativity6.

Response

{
    "response": {
        "folio": "616C16C8",
        "fileName": "csv_file_example.csv",
        "dateUpload": "2022-02-25T19:58:15.358+00:00",
        "status": "PROCESSING",
        "totalRecords": 20100
    },
    "message": "The csv file content is being read, the process will take a while..."
}

Response explanation

response: Object that contains the information of the file uploaded from the API, this object contains the following information:
folio: Unique alphanumeric identifier of the document, useful for tracking and later downloading.
fileName: Uploaded file name.
dateUpload: File upload date.
status: Uploaded file process status.
totalRecords: Total records to predict from the uploaded file.
message: Informative message about the status of the uploaded csv file.

Tracking file uploaded from API

To check the progress information of the csv file uploaded via the API, make an HTTP get call to the following URL:

https://api.usemarvin.ai/naics/naics/external/upload/file/info

Input in the following parameters:

NameTypeDescription
folioStringRequired. The unique alphanumeric identifier of the document.
tokenStringRequired. The API token provided by Relativity6.

Response object

The returned response should look like the following in JSON format:

{
    "response": {
        "folio": "616C16C8",
        "filename": "csv_file_example.csv",
        "description": "sample uploaded csv file",
        "createdAt": "2022-02-25T19:58:15.358+00:00",
        "records": 20100,
        "progressInfo": {
            "status": "PROCESSING",
            "processedPercentage": 95,
            "processedRecords": 19095,
            "successfulRecords": 18995,
            "failedRecords": 100
        },
        "segmentation": [
            {
                "part": 0,
                "range": "[1-10000]",
                "filename": "csv_file_example.csv_part_1.csv"
            },
            {
                "part": 1,
                "range": "[10001-20000]",
                "filename": "csv_file_example.csv_part_2.csv"
            }
        ],
        "failedInfo": {
                "part": 0,
                "range": "[1-100]",
                "filename": "csv_file_example.csv_failed_part_1.csv"
        }
    },
    "message": "Your file is being processed, at the moment it is not possible to download the parts indicated"
}

Response explanation

response: Object that contains the information of the file uploaded from the API, this object contains the following information:
folio: Unique alphanumeric identifier of the document, useful for tracking and later downloading.
fileName: Uploaded file name.
description: Annotations for user consideration.
createdAt: File upload date.
records: Total records to predict from the uploaded file.
progressInfo: Object containing the process status of the uploaded file:
status: Uploaded file status (PROCESSING or FINISHED).
processedPercentage: Number of processed records in percent.
processedRecords: Total amount of processed records.
successfulRecords: Total number of records processed successfully.
failedRecords: Total number of failed processed records.
segmentation: Object containing information about the segmentation of the uploaded file for later download:
part: File segment identifier to download.
range: Range of records that each file to download has.
filename: Range of records that each file to download has.
failedInfo: Object containing the information of the records that failed to predict.
part: File segment identifier to download:
range: Range of records that each file to download has.
filename: Range of records that each file to download has.
message: informative message about the status of the uploaded csv file.

Download uploaded document from API

To get the processed part of the file via API, make an HTTP get call to the following URL:

https://api.usemarvin.ai/naics/naics/external/upload/file/download

Input in the following parameters:

NameTypeDescription
folioStringRequired. The unique alphanumeric identifier of the document.
tokenStringRequired. The API token provided by Relativity6.
partIntegerRequired. The part number provided by previous endpoint.
fileStatusStringRequired. The type of records to download (SUCCESSFUL or FAILED).

Response

{
    "response": {
        "content": "ImNsaWVudF9pZCIsIm5hbWUiLCJpbnN1cmVkX2FkZHJlc3MiLCJpbnN1cmVkX2NpdH
        kiLCJpbnN1cmVkX3N0YXRlX2NvZGUiLCJpbnN1cmVkX3ppcF9jb2RlIiwiaXNvMzE2Nl8xX2NvdW50
        cnlfY29kZSIKLCwsIkNvc3RhIE1lc2EiLCJDQSIsLAosLCwsLCwKLCwsLCwsCiwsLCwsLAosLCwsLC
        wKLCwsLCJUTiIsLAosLCwiSG9vbmlnYW4sIExMQyIsIkNBIiwsCiwsLCwsLAosLCwsLCwKLCwsLCws
        CiwsLCJXZXNsZXkgQ2hhcGVsIiwsLAosLCwiV2F1a2VzaGEiLCwsCiwsLCJFbCBTZWd1bmRvIiwsLA
        osLCwsLCwKLCwsLCwsCiwsLCwsLAosLCwsLCwKLCwsIlBhbG0gSGFyYm9yIiwiRkwiLCwKLCwsIlJv
        YW5va2UiLCwsCiwsLCwsLAosLCwsLCwK",
        "filename": "csv_file_example_1646854791864.csv"
    },
    "message": "Uploaded file data successfully retrieved""
}

Response explanation

response: Object that contains the information of the part of the file to recover:
content: base64 encoded file.
filename: uploaded file name.
message: Informative message about the status of the download csv file.


Did this page help you?