Efficient Cloud Images
Efficient Cloud Images is a cost-effective image solution with powerful built-in features.
API Endpoints
https://graph.efficientimages.com/graph
Version
1.0.0
Account
An account is the top level of organization. Each account may have an infinite number of image libraries, and an infinite number of access keys.
See also:
Libraries
A library is a folder that contains one or more images. Each library belongs to a single account, may contain an infinite number of images, and has its own metrics and event hooks.
See also:
Images
A image represents a single image asset.
Image Rendering
You can resize and otherwise modify any image by passing the following optional query string parameters:
width=100- resizes to width=100height=100- resizes to height=100aspect_ratio=2:1- resizes to an aspect ratio of 2:1quality=100- modifies the image quality (max 100)sharpen=false- sharpens the image (true or false)blur=0- blurs the image (0 = no blur, 100 = max blur)crop=3500,3500,250,300- crops the image (width,height,x,y)flip=true- flips the image verticallyflop=true- flops the image horizontally
See also:
Adding Images
To upload an image, use the sign upload mutation to create an upload link. You should then upload the image in binary format to the response upload_url. Upon upload, the image will be immediately available as provided by the response download_url.
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": "xyz789",
"libraries": [Library]
}
}
}
get_image
Description
Get an image by ID
Example
Query
query get_image($id: String!) {
get_image(id: $id) {
id
created_at
updated_at
library_id
size
width
height
content_type
original_path
library {
...LibraryFragment
}
}
}
Variables
{"id": "abc123"}
Response
{
"data": {
"get_image": {
"id": "abc123",
"created_at": "2007-12-03T10:15:30Z",
"updated_at": "2007-12-03T10:15:30Z",
"library_id": "abc123",
"size": 123.45,
"width": 987.65,
"height": 123.45,
"content_type": "abc123",
"original_path": "abc123",
"library": Library
}
}
}
get_library
Description
Get a library by ID
Example
Query
query get_library($id: String!) {
get_library(id: $id) {
id
name
account_id
domain
total_image_count
total_image_size
account {
...AccountFragment
}
}
}
Variables
{"id": "abc123"}
Response
{
"data": {
"get_library": {
"id": "xyz789",
"name": "xyz789",
"account_id": "xyz789",
"domain": "xyz789",
"total_image_count": 987.65,
"total_image_size": 987.65,
"account": Account
}
}
}
list_images
Description
List the images in a library
Response
Returns [Image!]!
Example
Query
query list_images(
$limit: Float,
$offset: Float,
$library_id: String!
) {
list_images(
limit: $limit,
offset: $offset,
library_id: $library_id
) {
id
created_at
updated_at
library_id
size
width
height
content_type
original_path
library {
...LibraryFragment
}
}
}
Variables
{
"limit": 123.45,
"offset": 987.65,
"library_id": "abc123"
}
Response
{
"data": {
"list_images": [
{
"id": "abc123",
"created_at": "2007-12-03T10:15:30Z",
"updated_at": "2007-12-03T10:15:30Z",
"library_id": "abc123",
"size": 123.45,
"width": 123.45,
"height": 123.45,
"content_type": "abc123",
"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_image_count
total_image_size
account {
...AccountFragment
}
}
}
Response
{
"data": {
"list_libraries": [
{
"id": "xyz789",
"name": "abc123",
"account_id": "abc123",
"domain": "xyz789",
"total_image_count": 987.65,
"total_image_size": 987.65,
"account": Account
}
]
}
}
Mutations
create_library
Description
Create a new library
Example
Query
mutation create_library($name: String!) {
create_library(name: $name) {
id
name
account_id
domain
total_image_count
total_image_size
account {
...AccountFragment
}
}
}
Variables
{"name": "xyz789"}
Response
{
"data": {
"create_library": {
"id": "xyz789",
"name": "abc123",
"account_id": "xyz789",
"domain": "abc123",
"total_image_count": 123.45,
"total_image_size": 123.45,
"account": Account
}
}
}
delete_image
Description
Delete an image
delete_library
Description
Create a new library
import_image
Description
Import an image from an external URL
Response
Returns an Image!
Example
Query
mutation import_image(
$url: String!,
$library_id: String!
) {
import_image(
url: $url,
library_id: $library_id
) {
id
created_at
updated_at
library_id
size
width
height
content_type
original_path
library {
...LibraryFragment
}
}
}
Variables
{
"url": "xyz789",
"library_id": "abc123"
}
Response
{
"data": {
"import_image": {
"id": "xyz789",
"created_at": "2007-12-03T10:15:30Z",
"updated_at": "2007-12-03T10:15:30Z",
"library_id": "xyz789",
"size": 123.45,
"width": 987.65,
"height": 123.45,
"content_type": "xyz789",
"original_path": "xyz789",
"library": Library
}
}
}
sign_upload
Response
Returns a SignedUpload!
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": "abc123",
"download_url": "xyz789"
}
}
}
update_library
Description
Create a new library
Response
Returns a Library!
Example
Query
mutation update_library(
$name: String!,
$id: String!
) {
update_library(
name: $name,
id: $id
) {
id
name
account_id
domain
total_image_count
total_image_size
account {
...AccountFragment
}
}
}
Variables
{
"name": "abc123",
"id": "xyz789"
}
Response
{
"data": {
"update_library": {
"id": "xyz789",
"name": "abc123",
"account_id": "xyz789",
"domain": "abc123",
"total_image_count": 987.65,
"total_image_size": 987.65,
"account": Account
}
}
}
Types
Account
Fields
| Field Name | Description |
|---|---|
id - String!
|
The ID of the account |
name - String!
|
The name of the account |
libraries - [Library!]!
|
A list of libraries that belong to this account |
Example
{
"id": "xyz789",
"name": "xyz789",
"libraries": [Library]
}
Boolean
Description
The Boolean scalar type represents true or false.
Example
true
DateTime
Description
The javascript Date as string. Type represents date and time as the ISO Date string.
Example
"2007-12-03T10:15:30Z"
Float
Description
The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.
Example
123.45
Image
Fields
| Field Name | Description |
|---|---|
id - String!
|
The identifier for this image |
created_at - DateTime!
|
The date this image was first uploaded / imported |
updated_at - DateTime!
|
The date this image was last modified |
library_id - String!
|
The ID of the library that owns this image |
size - Float!
|
The size of this image file (bytes) |
width - Float!
|
The width of this image (pixels) |
height - Float!
|
The height of this image (pixels) |
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 image |
Example
{
"id": "xyz789",
"created_at": "2007-12-03T10:15:30Z",
"updated_at": "2007-12-03T10:15:30Z",
"library_id": "xyz789",
"size": 123.45,
"width": 123.45,
"height": 123.45,
"content_type": "xyz789",
"original_path": "abc123",
"library": Library
}
Library
Fields
| Field Name | Description |
|---|---|
id - String!
|
The ID for this image library |
name - String!
|
The user-provided name for this image library |
account_id - String!
|
The ID of the account that owns this image library |
domain - String
|
The primary domain associated with this image library |
total_image_count - Float!
|
The total number of images in this library (cached) |
total_image_size - Float!
|
The total size of images in this library (cached) |
account - Account!
|
The account that owns this library |
Example
{
"id": "abc123",
"name": "abc123",
"account_id": "abc123",
"domain": "abc123",
"total_image_count": 987.65,
"total_image_size": 987.65,
"account": Account
}
SignedUpload
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"