Service Endpoint

http://api.sandcage.com/0.2/list-files


Example Request Payload

{"key":"Your API key.","directory":"img\/"}

Example Success Response

{"request_id":"req__wLKtvTJXQXK9GFQrmxnIgnQYRmZ45RyBT89Ig","status":"success","files":[{"reference_id":"757q","file_token":"file_bpa4zb_a5_d7l9ksejrlra0i_bu1xj7","directory":"img\/","filename":"logo.png","type":"image\/png","size":6804,"status":"processed","url":"http:\/\/www.example.com\/img\/logo.jpg"},{"reference_id":"lukra","file_token":"file_tuker4br7t1vg8ssupfmykp6_l69cib2wuk8","directory":"img\/","filename":"header.png","type":"image\/png","size":0,"status":"pending"},{"reference_id":"job52d","file_token":"file_85eixnam5sg5afa1qmn6j_qxao3039z0xbhd59","directory":"img\/","filename":"banner.png","type":"image\/png","size":0,"status":"error"}]}

Example Error Response

{"request_id":"req__wLKtvTJXQXK9GFQrmxnIgnQYRmZ45RyBT89Ig","status":"error","error_msgs":[{"code":1234,"short":"Short error message","long":"This is a long error message that describes in more detail the error that occurred."}]}

Example Success Response With Warning

{"request_id":"req__wLKtvTJXQXK9GFQrmxnIgnQYRmZ45RyBT89Ig","status":"success","warning_msgs":[{"code":1234,"short":"Short warning message","long":"This is a long warning message that describes in more detail the issue that occurred."}]}

Request Parameters

key*

string

requiredYour API key.
directory

string

1...500

optionalThe relative directory to search through.
Default is the root directory.
page

integer

1...

optionalThe targeted paginated results.
Default is 1.
results_per_page

integer

1...200

optionalThe amount of file entries that should be returned per request.
Default is 100.

Response Format

request_id

string

A unique identifier for this request.
status

string

Either "success" or "error".
pages

integer

The total number of pages, based on the default or provided value of "results_per_page".
Will only be included as part of the response if the request was successful.
files

array

An array of files.
Will only be included as part of the response if the request was successful.
files[]

struct

A file.
reference_id

string

The unique reference identifier that was optionally provided for the file.
file_token

string

The token of the file.
directory

string

The targeted directory in the associated storage location where the file is stored.
filename

string

The file name of the file.
type

string

The mime type of the file.
size

string

The size of the file on disk in bytes.
Unless the file was successful processed (the value of "status" will be "processed") a value of 0 will be returned.
status

string

One of the following values:
  • pending
  • processed
  • error
url

string

The url where the file can be accessed from. This is only returned if the file was successful processed (the value of "status" will be "processed").
error_msgs

array

An array of errors.
Error messages will only be included as part of the response if the request was not successful.
error_msgs[]

struct

An error.
code

string

The error code.
short

string

The short error message.
long

string

The long and more detailed error message.
warning_msgs

array

An array of warnings.
Warning messages will only be included as part of the response if the request was successful.
warning_msgs[]

struct

A warning.
code

string

The warning code.
short

string

The short warning message.
long

string

The long and more detailed warning message.

Still Have Questions?

We're always happy to help with code and integrations. Talk to us!