File

File Schema
  • id: Unique id for every file

  • parent_id: Unique id for parent file

  • name: name of the file

  • is_folder: File type, True means folder and false means file

  • ext:

  • type: Type of file

  • file_paths: paths of file

  • uuid: Unique identifier string(UUID Format)

  • size: Size of the file

  • active: Active/Inactive state of file

  • created_at: File creation timestamp

  • modified_at: Last modified timestamp of file

  • mime_type: Mime type of the file

  • num_files:

  • lable: The lable of the file

  • metadata: The file metadata

  • file_urls: The actual url of the file

Upload File From URL

POST https://api.gmetri.com/sdk/file/uploadFileFromURL

Create new file from url

Headers

Name
Type
Description

Authorization*

String

Token <apiToken>

Request Body

Name
Type
Description

orgSlug*

String

Unique identifier string of the organization

url*

String

The file url

relativePath

String

name

String

Name of the file

thumbnailURL

String

The url of thumbnail

{
    "status": {
        "success": true
    },
    "data": {
        "id": 438554,
        "parent_id": 438477,
        "name": "1 (3).jpg",
        "is_folder": false,
        "ext": null,
        "type": "IMAGE",
        "file_paths": {
            "o": "o/1.jpg"
        },
        "uuid": "c6f34f02-0cb9-46b2-a40d-62ea41b895b7",
        "size": "44891",
        "active": true,
        "created_at": "2022-10-20T12:53:35.228Z",
        "modified_at": "2022-10-20T12:53:35.382Z",
        "mime_type": null,
        "num_files": null,
        "label": null,
        "metadata": null,
        "file_urls": {
            "o": "https://u.vrgmetri.com/gm-gb-test/media/2022-9/yzvcei/c6f34f02-0cb9-46b2-a40d-62ea41b895b7/o/1.jpg"
        }
    }
}

Get File

POST https://api.gmetri.com/sdk/file/get

Get file by id

Headers

Name
Type
Description

Authorization*

String

Token <apiToken>

Request Body

Name
Type
Description

orgSlug*

String

Unique identifier string of the organization

fileId*

Number

Unique ID of the file

Create Folder

POST https://api.gmetri.com/sdk/file/createFolder

Create folder by name inside given parent

Headers

Name
Type
Description

Authorization*

String

Token <apiToken>

Request Body

Name
Type
Description

orgSlug*

String

Unique identifier string of the organization

name*

String

The name of folder

parentId*

Number

Parent folder unique id

List Folder

POST https://api.gmetri.com/sdk/file/listFolder

List all file and folder from root or parent folder

Headers

Name
Type
Description

Authorization*

String

Token <apiToken>

Request Body

Name
Type
Description

orgSlug*

String

Unique identifier string of the organization

folderId*

Number

Parent folder unique id

Get Root File ID

POST https://api.gmetri.com/sdk/file/getRootFileId

Get root file by root name

Headers

Name
Type
Description

Authorization*

String

Token <apiToken>

Request Body

Name
Type
Description

orgSlug*

String

Unique identifier string of the organization

Last updated

Was this helpful?