Create

Create a new upload token

The upload token can be used to upload files to the platform. See the Uploadtoken command for details on how to use the upload token.

This action requires a request with an active account.

Tokens

This action requires the following tokens:

  • item-upload

Arguments

Required arguments are marked in bold, and optional arguments are marked in italics.

Argument Type Default Description
validfor Duration 3600 The duration that the upload token is valid for; the upload must be completed within this period; values larger than 24 hours are not permitted
item Hash   If set, the item to which the uploaded file must be added; if not set, a new item will be created
thumbnail Integer 0 Whether the uploaded file should be used as a thumbnail. When 1, the new file will be added as a thumbnail to the item; when 2, the new file will be added as the currently selected thumbnail; when 0, it will be added as a file.

Output

This action produces the following output on success:

An object containing the following fields:

Name Type Description
token String The newly created upload token
uploadurl String The URL to send the file to; see the documentation of the Uploadtoken command for more information on what to send to this URL
uploadurlhttps String The URL to send the file to if using HTTPS; this might not be available on every platform
itemid Hash The ID of the item that the file will be added to, or, if a new item is to be created, the ID that this newly created item will have after the upload has been completed
fileid Hash The ID that this newly created file will have after the upload has been completed

Errors

This action can return one of the default status codes, or one of the following status codes on error:

STATUS_ITEM_NOT_FOUND (120)
The given item does not exist.