# Get file versions

#### **End Point** <a href="#end-point" id="end-point"></a>

```javascript
{{base_url}}/get-file/{{fileId}}
```

#### **API Description** <a href="#api-description" id="api-description"></a>

This API endpoint, accessed through the specified URL, enables the retrieval of an array containing all versions associated with a particular file identified by the provided \<file\_id>.

```javascript
/get-file/<file_id>
```

**Notes:**

* The process of creating a certificate involves the automatic creation of a parent file in the background. The first version (certificate) is then associated with this file.
* The system allows for the addition of multiple versions to a file, providing a comprehensive history of the file's certification journey.\
  \
  This API serves as a valuable resource for obtaining a complete overview of the versions associated with a given file within the MyIPR system.

**Method**

POST&#x20;

**Attributes**

<table><thead><tr><th width="182">Attribute</th><th width="96">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>status</strong></td><td>Integer</td><td>Represents the status of the API response.</td></tr><tr><td><strong>message</strong></td><td>String</td><td>Provides a message indicating the success or failure of the API request.</td></tr><tr><td><strong>results</strong></td><td>Array of Objects</td><td>Contains an array of objects with information about the submitted file(s).</td></tr><tr><td><strong>hash</strong></td><td>String</td><td>The hash value of the file.</td></tr><tr><td><strong>size</strong></td><td>String</td><td>The size of the file.</td></tr><tr><td><strong>result</strong></td><td>Object</td><td>Contains information about the submitted version.</td></tr><tr><td><strong>result.version_id</strong></td><td>String</td><td>Unique identifier for the version of the file.</td></tr><tr><td><strong>result.fileId</strong></td><td>String</td><td>Unique identifier for the submitted file.</td></tr><tr><td><strong>result.version_name</strong></td><td>String</td><td>The name of the file version.</td></tr><tr><td><strong>result.fileName</strong></td><td>String</td><td>The name of the file.</td></tr><tr><td><strong>result.fileStatus</strong></td><td>String</td><td>The status of the file (e.g., "in_progress").</td></tr><tr><td><strong>result.is_primary</strong></td><td>Boolean</td><td>Indicates whether the file is the primary file.</td></tr><tr><td><strong>result.size</strong></td><td>String</td><td>The size of the file.</td></tr><tr><td><strong>result.description</strong></td><td>String</td><td>Description of the file, if available.</td></tr><tr><td><strong>result.transaction_id</strong></td><td>String</td><td>Unique identifier for the transaction related to the file.</td></tr><tr><td><strong>result.hash</strong></td><td>String</td><td>The hash value of the file.</td></tr><tr><td><strong>result.category</strong></td><td>Object</td><td>Contains information about the category of the file.</td></tr><tr><td><strong>result.category.id</strong></td><td>Integer</td><td>Unique identifier for the category.</td></tr><tr><td><strong>result.category.name</strong></td><td>String</td><td>The name of the category.</td></tr><tr><td><strong>result.status</strong></td><td>String</td><td>The overall status of the file (e.g., "completed").</td></tr><tr><td><strong>result.error</strong></td><td>Object</td><td>Object containing information about any errors, if applicable.</td></tr><tr><td><strong>result.user</strong></td><td>Object</td><td>Contains information about the user associated with the file.</td></tr><tr><td><strong>result.user.id</strong></td><td>String</td><td>Unique identifier for the user.</td></tr><tr><td><strong>result.user.first_name</strong></td><td>String</td><td>The first name of the user.</td></tr><tr><td><strong>result.user.last_name</strong></td><td>String</td><td>The last name of the user.</td></tr><tr><td><strong>result.user.email</strong></td><td>String</td><td>The email address of the user.</td></tr><tr><td><strong>result.created_at</strong></td><td>String</td><td>The timestamp indicating when the file was created.</td></tr><tr><td><strong>result.lastUpdatedAt</strong></td><td>String</td><td>The timestamp indicating when the file was last updated.</td></tr></tbody></table>

#### Request <a href="#sample-request" id="sample-request"></a>

```javascript
curl --location -g --request POST '{{base_url}}/get-file/f8d0f158-7d33-44f3-8025-fb9b9402a74e' \
--header 'Authorization: SECRET {{secret_key}}'
```

#### Response <a href="#sample-response-success-response" id="sample-response-success-response"></a>

```javascript
{
  "status": 201,
  "message": "success",
  "result": [
    {
      "version_id": "76233ed6-b9d0-46b5-bd4c-5cda20d7c622",
      "fileId": "f8d0f158-7d33-44f3-8025-fb9b9402a74e",
      "version_name": "This is a new file 13099",
      "fileName": "This is a new file 13099",
      "fileStatus": "in_progress",
      "is_primary": true,
      "size": "1079",
      "description": null,
      "transaction_id": "cb81ae60f3e2d28891a10bdce747f76b1acb73e7df770de68d04933c851260ac",
      "hash": "c5455acc691c249007aa739f2e4ff7651e549c4e9b471c9b0b327d2d61db1617",
      "category": {
        "id": 10,
        "name": "Legal"
      },
      "status": "completed",
      "error": {},
      "user": {
        "id": "2ebe5490-ce56-42c2-afbe-20b5de491a37",
        "first_name": "business",
        "last_name": "varsha",
        "email": "varshadev6@yopmail.com"
      },
      "created_at": "2023-11-24T05:55:34.128Z",
      "lastUpdatedAt": "2023-11-24T05:55:39.489Z"
    }
  ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.myipr.io/myipr-open-api/api-guides/api-reference/get-file-versions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
