API Method: /api/action/upload

Upload a file for a an action variable.

Parameters

ParameterDescription
file (required)The file to upload.
action_id (required)To action to upload content to.
variable_name (required)The action variable to upload the file to.

Parameters for Resumable.js

This API method support an extra set of parameters designed to work with Resumable.js, an open sourced JavaScript library for providing multiple simultaneous, stable, fault-tolerant and resumable uploads via the HTML5 File API released by TwentyThree.

To handle the state of upload chunks, a number of extra parameters are sent along with such requests:

API methods expect all chunks of a file to be uploaded before the file is added to the archive. When the last chunk's upload completes, the messages listed in the Returns section applies. For all other chunk, HTTP status codes control the flow:

Permission level

The minimum required permission level is:

read

Example XML Response

<response status="ok" permission_level="write" 
  message="The action was updated" cached="0">

Example JSON Response

{
  "status": "ok", 
  "message":"The action was updated",
  "permission_level":"write",
  "cached":"0",
  "album":{},
  "p": "1",
  "size": "1",
  "site": { ...},
  "endpoint": "/api/album/upload"
}