# Get File Details

This API serves as a powerful tool for retrieving comprehensive information about files stored on the IPFS, a decentralized and distributed file storage protocol.The weightage for this API is 10

## API Specification

## Get File Details

<mark style="color:green;">`POST`</mark> `https://api.krypcore.com/api/v0/storagemanageripfs/getFileDetails`

Gets the file details from the storage under the given instance.&#x20;

#### Headers

| Name                                            | Type   | Description                      |
| ----------------------------------------------- | ------ | -------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | User Auth Key obtained from Dash |
| DappId                                          | String | DappId                           |

#### Request Body

| Name     | Type   | Description                                                     |
| -------- | ------ | --------------------------------------------------------------- |
| page     | Number | Details of uploaded files to be retrieved for the given page No |
| pageSize | Number | No of uploaded files details to be displayed per page           |

{% tabs %}
{% tab title="200: OK Uploaded Files details fetched successfully" %}

```javascript
{
    "Data": {
        "data": [
            {
                "_id": "650d4add128b1b6f75e72b99",
                "apiHits": 0,
                "createdAt": "2023-09-22T08:05:49.876Z",
                "credits": 0,
                "currentFlag": false,
                "fileName": "download.png",
                "fileSize": "5212",
                "fileURL": "https://ipfs-gateway.node.krypcore.io/api/v0/ipfs/b0c27263-efba-4cfa-83e6-xxxxxxxxxxxx/ipfs/QmW6Vavg8DMvobsvA2wjYNktaCEYp7bxdmxxxxxxxxxxxxx",
                "instanceID": "INS_ST_19_2023919",
                "instanceKey": "",
                "ipfsHash": "QmbVnEgY9K1Qypb6Rqf81U8SfmoUfYNgTdsJm3JtvSTYKZ",
                "ipfsStorageId": "SM_IPFS_2023922549876127864",
                "pinStatus": true,
                "status": "ACTIVE",
                "storageProtocol": "IPFS",
                "updatedAt": "2023-09-22T08:05:49.876Z",
                "uploadedByUserId": "",
                "version": 0
            },
        ],
        "totalCount": 1
    },
    "Message": "Records fetched successfully",
    "Status": "SUCCESS"
}
```

{% endtab %}

{% tab title="401: Unauthorized Authorization Key is missing in the header" %}

```json
{
    "message": "Missing API key found in request"
}
```

{% endtab %}
{% endtabs %}

Take a look at how you might call this method using our official libraries, or via `curl`:

{% tabs %}
{% tab title="curl" %}

```bash
curl --location --request POST 'https://api.krypcore.com/api/v0/storagemanageripfs/getFileDetails' \
--header 'Authorization: xxxxxx-xxxx-xxxx-xxxx-xxxxxxx' \
--header 'DappId: xxx_xx_xx_xxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
  "page": 0,
  "pageSize": 10
}'
```

{% endtab %}

{% tab title="Node.js (Fetch)" %}

```javascript
var axios = require('axios');
var data = JSON.stringify({
  "page": 0,
  "pageSize": 10
});

var config = {
  method: 'post',
  url: 'https://api.krypcore.com/api/v0/storagemanageripfs/getFileDetails',
  headers: { 
    'Authorization': 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxx', 
    'DappId': 'xxx_xx_xx_xxxxxxxx', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

```

{% endtab %}

{% tab title="Python " %}

```python
import requests
import json

url = "https://api.krypcore.com/api/v0/storagemanageripfs/getFileDetails"

payload = json.dumps({
  "page": 0,
  "pageSize": 10
})
headers = {
  'Authorization': 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxx', 
    'DappId': 'xxx_xx_xx_xxxxxxxx',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

{% endtab %}

{% tab title="Golang" %}

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://web3-proxy-dev.krypcore.com/api/v0/storagemanageripfs/getFileDetails"
  method := "POST"

  payload := strings.NewReader(`{
  "page": 0,
  "pageSize": 10
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "xxxxxx")
  req.Header.Add("DappId", "xxxxxx")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endtab %}
{% endtabs %}
