Controls the creation, polling, and retrieval of user-requested downloads.
Downloads API
Interfaces
Object Synopses
DownloadRequest
-
download_type
String
Required. The type of download
-
info
Object
Optional. Parameters for the download. Currently unused.
DownloadResponse
-
id
String
Unique identifier of the download
-
download_type
String
The type of download
-
user_id
String
The unique identifier of the originating user
-
state
String
The state of the download
-
url
String
The relative URL for the download’s file. Will be null if the fils is in any state but “done”
Show a download's details
GET
/api/downloads/:id
Response Codes
200 OK
if resource is found
403 Forbidden
if the user isn’t the user who created the download or
doesn’t have permissions to view the type of the download
404 Not Found
if the download doesn’t exist
Example Response
{
"download": "{API::DownloadResponse}"
}
Create a new download
POST
/api/downloads
Response Codes
201 Created
if resource is created
403 Forbidden
if the user doesn’t have permissions to create the
requested download type
422 Unprocessable Entity
if resource is not created
Parameters
-
Body parameter. A hash of download parameters.
Example Request
Example Response
{
"download": "{API::DownloadResponse}"
}
Get the actual file associated with a download
GET
/api/downloads/:id/file
Response Codes
302 Found
if resource exists
403 Forbidden
if the user isn’t the user who created the download or
doesn’t have permissions to view the type of the download
404 Not Found
if the download doesn’t exist or it hasn’t finished
processing
Interfaces
Object Synopses
DownloadRequest
-
download_type
StringRequired. The type of download
-
info
ObjectOptional. Parameters for the download. Currently unused.
DownloadResponse
-
id
StringUnique identifier of the download
-
download_type
StringThe type of download
-
user_id
StringThe unique identifier of the originating user
-
state
StringThe state of the download
-
url
StringThe relative URL for the download’s file. Will be null if the fils is in any state but “done”
Show a download's details
GET
/api/downloads/:id
Response Codes
200 OK
if resource is found403 Forbidden
if the user isn’t the user who created the download or doesn’t have permissions to view the type of the download404 Not Found
if the download doesn’t exist
Example Response
{ "download": "{API::DownloadResponse}" }
Create a new download
POST
/api/downloads
Response Codes
201 Created
if resource is created403 Forbidden
if the user doesn’t have permissions to create the requested download type422 Unprocessable Entity
if resource is not created
Parameters
-
Body parameter. A hash of download parameters.
Example Request
Example Response
{ "download": "{API::DownloadResponse}" }
Get the actual file associated with a download
GET
/api/downloads/:id/file
Response Codes
302 Found
if resource exists403 Forbidden
if the user isn’t the user who created the download or doesn’t have permissions to view the type of the download404 Not Found
if the download doesn’t exist or it hasn’t finished processing