Migrating originals

Migrating the flows for source documents is a crucial flow common to all integrations.

The steps below illustrate the changes required to migrate the API flows to v2.

Creating an original document

POST /v1/files/original/

Content-Type: mulipart/form-data

file: <file_contents>
name: <File name>
POST /v2/original/

Content-Type: mulipart/form-data

file: <file_contents>
name: <File name>

List all original documents

GET /v1/files/original/

{
    "count": 2,
    "files": [
        {
          "created_time": 1590751553,
          "id": 23188790,
          "last_modified_time": 1590751553,
          "name": "IT Contract - Employee (Anirjit Bakshi).pdf"
        },
        {
            "created_time": 1588142205,
            "id": 23187514,
            "last_modified_time": 1588142206,
            "name": "IT Contract - Employee (Prashanth Raghu).pdf"
        }
    ]
}
GET /v2/original/

{
    "count": 2,
    "files": [
        {
          "created_time": 1590751553,
          "id": 23188790,
          "last_modified_time": 1590751553,
          "name": "IT Contract - Employee (Anirjit Bakshi).pdf"
        },
        {
            "created_time": 1588142205,
            "id": 23187514,
            "last_modified_time": 1588142206,
            "name": "IT Contract - Employee (Prashanth Raghu).pdf"
        }
    ]
}

Fetch details of a single original document

GET /v1/files/original/<original_id>


{
  "created_time": 1590751553,
  "id": 23188790,
  "last_modified_time": 1590751553,
  "name": "IT Contract - Employee (Anirjit Bakshi).pdf"
}
GET /v2/original/<original_id>

{
  "created_time": 1590751553,
  "id": 23188790,
  "last_modified_time": 1590751553,
  "name": "IT Contract - Employee (Anirjit Bakshi).pdf"
}

Download single original document as PDF

GET /v1/files/original/<original_id>/download/
GET /v2/original/<original_id>/download/

Delete a single original document

DELETE /v1/files/original/<original_id>
DELETE /v2/original/<original_id>