Efficient Cloud Files

Efficient Cloud Files is a cost-effective document hosting solution.

Contact

Efficient Cloud Support

help@efficientcloud.com

API Endpoints
https://graph.efficientfiles.com/graph
Version

1.0.0

Account

An account is the top level of organization. Each account may have an infinite number of libraries, and an infinite number of access keys.

See also:

Libraries

A library is a folder that contains one or more documents. Each library belongs to a single account, may contain an infinite number of documents, and has its own metrics and event hooks.

See also:

Files

A file represents a single file asset.

See also:

Adding Files

To add a document, use the sign upload mutation to create an upload link. You should then upload the file in binary format to the response upload_url. Upon upload, the file will be immediately available at a temporary hosting URL as provided by the response download_url. Efficient Cloud Files will then import the uploaded file to the relevant file library and delete it from the temporary hosting location. Use hooks to receive updates on progress.

Queries

get_account

Description

Get details on your account

Response

Returns an Account!

Example

Query
query get_account {
  get_account {
    id
    name
    libraries {
      ...LibraryFragment
    }
  }
}
Response
{
  "data": {
    "get_account": {
      "id": "abc123",
      "name": "abc123",
      "libraries": [Library]
    }
  }
}

get_file

Description

Gets a file by ID

Response

Returns a File!

Arguments
Name Description
id - String! The ID of the file to fetch

Example

Query
query get_file($id: String!) {
  get_file(id: $id) {
    id
    created_at
    updated_at
    library_id
    size
    content_type
    original_path
    library {
      ...LibraryFragment
    }
  }
}
Variables
{"id": "xyz789"}
Response
{
  "data": {
    "get_file": {
      "id": "abc123",
      "created_at": "2007-12-03T10:15:30Z",
      "updated_at": "2007-12-03T10:15:30Z",
      "library_id": "abc123",
      "size": 123.45,
      "content_type": "xyz789",
      "original_path": "xyz789",
      "library": Library
    }
  }
}

get_library

Description

Get a library by ID

Response

Returns a Library!

Arguments
Name Description
id - String! The id of the library to fetch

Example

Query
query get_library($id: String!) {
  get_library(id: $id) {
    id
    name
    account_id
    domain
    total_file_count
    total_file_size
    account {
      ...AccountFragment
    }
  }
}
Variables
{"id": "xyz789"}
Response
{
  "data": {
    "get_library": {
      "id": "xyz789",
      "name": "xyz789",
      "account_id": "abc123",
      "domain": "xyz789",
      "total_file_count": 987.65,
      "total_file_size": 987.65,
      "account": Account
    }
  }
}

list_files

Description

Lists the files in a library

Response

Returns [File!]!

Arguments
Name Description
limit - Float
offset - Float
library_id - String! The library to list files from

Example

Query
query list_files(
  $limit: Float,
  $offset: Float,
  $library_id: String!
) {
  list_files(
    limit: $limit,
    offset: $offset,
    library_id: $library_id
  ) {
    id
    created_at
    updated_at
    library_id
    size
    content_type
    original_path
    library {
      ...LibraryFragment
    }
  }
}
Variables
{
  "limit": 123.45,
  "offset": 987.65,
  "library_id": "xyz789"
}
Response
{
  "data": {
    "list_files": [
      {
        "id": "abc123",
        "created_at": "2007-12-03T10:15:30Z",
        "updated_at": "2007-12-03T10:15:30Z",
        "library_id": "abc123",
        "size": 123.45,
        "content_type": "xyz789",
        "original_path": "xyz789",
        "library": Library
      }
    ]
  }
}

list_libraries

Description

List all the libraries in your account

Response

Returns [Library!]!

Example

Query
query list_libraries {
  list_libraries {
    id
    name
    account_id
    domain
    total_file_count
    total_file_size
    account {
      ...AccountFragment
    }
  }
}
Response
{
  "data": {
    "list_libraries": [
      {
        "id": "xyz789",
        "name": "abc123",
        "account_id": "abc123",
        "domain": "abc123",
        "total_file_count": 123.45,
        "total_file_size": 123.45,
        "account": Account
      }
    ]
  }
}

Mutations

create_library

Description

Create a new library

Response

Returns a Library!

Arguments
Name Description
name - String! A name for the new library

Example

Query
mutation create_library($name: String!) {
  create_library(name: $name) {
    id
    name
    account_id
    domain
    total_file_count
    total_file_size
    account {
      ...AccountFragment
    }
  }
}
Variables
{"name": "xyz789"}
Response
{
  "data": {
    "create_library": {
      "id": "abc123",
      "name": "abc123",
      "account_id": "xyz789",
      "domain": "xyz789",
      "total_file_count": 123.45,
      "total_file_size": 123.45,
      "account": Account
    }
  }
}

delete_file

Description

Delete a file

Response

Returns a Boolean!

Arguments
Name Description
id - String! The ID of the file to delete

Example

Query
mutation delete_file($id: String!) {
  delete_file(id: $id)
}
Variables
{"id": "xyz789"}
Response
{"data": {"delete_file": false}}

delete_library

Description

Create a new library

Response

Returns a Boolean!

Arguments
Name Description
id - String! The id of the library to delete

Example

Query
mutation delete_library($id: String!) {
  delete_library(id: $id)
}
Variables
{"id": "xyz789"}
Response
{"data": {"delete_library": true}}

import_file

Description

Import a file from an external URL

Response

Returns a File!

Arguments
Name Description
url - String! The URL of the file to import
library_id - String! The ID of the library to import this file into

Example

Query
mutation import_file(
  $url: String!,
  $library_id: String!
) {
  import_file(
    url: $url,
    library_id: $library_id
  ) {
    id
    created_at
    updated_at
    library_id
    size
    content_type
    original_path
    library {
      ...LibraryFragment
    }
  }
}
Variables
{
  "url": "xyz789",
  "library_id": "abc123"
}
Response
{
  "data": {
    "import_file": {
      "id": "abc123",
      "created_at": "2007-12-03T10:15:30Z",
      "updated_at": "2007-12-03T10:15:30Z",
      "library_id": "abc123",
      "size": 123.45,
      "content_type": "abc123",
      "original_path": "abc123",
      "library": Library
    }
  }
}

sign_upload

Response

Returns a SignedUpload!

Arguments
Name Description
content_type - String!
library_id - String!

Example

Query
mutation sign_upload(
  $content_type: String!,
  $library_id: String!
) {
  sign_upload(
    content_type: $content_type,
    library_id: $library_id
  ) {
    upload_url
    download_url
  }
}
Variables
{
  "content_type": "xyz789",
  "library_id": "xyz789"
}
Response
{
  "data": {
    "sign_upload": {
      "upload_url": "xyz789",
      "download_url": "abc123"
    }
  }
}

update_library

Description

Create a new library

Response

Returns a Library!

Arguments
Name Description
name - String! A new name for the library
id - String! The id of the library to update

Example

Query
mutation update_library(
  $name: String!,
  $id: String!
) {
  update_library(
    name: $name,
    id: $id
  ) {
    id
    name
    account_id
    domain
    total_file_count
    total_file_size
    account {
      ...AccountFragment
    }
  }
}
Variables
{
  "name": "xyz789",
  "id": "xyz789"
}
Response
{
  "data": {
    "update_library": {
      "id": "xyz789",
      "name": "abc123",
      "account_id": "xyz789",
      "domain": "abc123",
      "total_file_count": 987.65,
      "total_file_size": 123.45,
      "account": Account
    }
  }
}

Types

Account

Fields
Field Name Description
id - String! The ID of the account
name - String! The name of the account
libraries - [Library!]! The list of libraries belonging to this account
Example
{
  "id": "xyz789",
  "name": "abc123",
  "libraries": [Library]
}

Boolean

Description

The Boolean scalar type represents true or false.

DateTime

Description

The javascript Date as string. Type represents date and time as the ISO Date string.

Example
"2007-12-03T10:15:30Z"

File

Fields
Field Name Description
id - String! The identifier for this file
created_at - DateTime! The date this file was first uploaded / imported
updated_at - DateTime! The date this file was last modified
library_id - String! The ID of the library that owns this file
size - Float The size of this file (bytes)
content_type - String! The mime/content type of this image
original_path - String! The relative path of the original file
library - Library! The library that owns this file
Example
{
  "id": "xyz789",
  "created_at": "2007-12-03T10:15:30Z",
  "updated_at": "2007-12-03T10:15:30Z",
  "library_id": "xyz789",
  "size": 987.65,
  "content_type": "abc123",
  "original_path": "xyz789",
  "library": Library
}

Float

Description

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

Example
987.65

Library

Fields
Field Name Description
id - String! The ID for this library
name - String! The user-provided name for this library
account_id - String! The ID of the account that owns this library
domain - String The primary domain associated with this library
total_file_count - Float! The total number of files in this library (cached)
total_file_size - Float! The total size of files in this library (cached)
account - Account! The account that owns this library
Example
{
  "id": "xyz789",
  "name": "xyz789",
  "account_id": "abc123",
  "domain": "abc123",
  "total_file_count": 987.65,
  "total_file_size": 987.65,
  "account": Account
}

SignedUpload

Fields
Field Name Description
upload_url - String!
download_url - String!
Example
{
  "upload_url": "abc123",
  "download_url": "abc123"
}

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"abc123"