collection.downloadHTML
Starts generating the download package and returns the progress status. When the status is complete it also returns the resource url.
Note: Requests must be made to https://api.flipsnack.com/v1.

Request parameters

Name
Type
Description
apiKey (required)
string
The API key provided for your user. If it is not specified, the request will return the error code "30 - Missing mandatory parameter". If the key is incorrect the request returns the error code "41 - Invalid credentials".
signature (required)
string
The signature must be calculated by you and added to the request. See How to sign a request for more information. If the parameter is missing the request will return the error code "30 - Missing mandatory parameter". If the signature is incorrect the request will return the error code "44 - Invalid signature".
action (required)
string
The API method that should be called. In this case the value should be collection.getStats. If it is not specified, the request will return the error code "30 - Missing mandatory parameter".
collectionHash (required)
string
The hash of the collection for which you want the download package. If you do not specify a collection hash, then the request will return the error code "30 - Missing mandatory parameter".
format
string
The format of the response from the server. Possible values are json, jsonp and xml. If you set format to jsonp, you must also specify the callback parameter.
Default: json.
callback
string
The name of the callback function used for the jsonp response. This parameter is required if format is set to jsonp. Otherwise it is ignored.

Response parameters

Name
Type
Description
status
string
The status of the download package. Possible values are
  • PROCESSING: the request is being processed;
  • COMPLETE: the package has been successfully generated;
  • FAILED: the package could not be generated
Generating a download package is a time consuming process. You can check the status at a few second intervals by using the collection.downloadHTML method. The requests to collection.downloadHTML should be made until the download package is generated. If the download package is already generated when the first request to collection.downloadHTML is made, the COMPLETE status will be returned.
resourceUrl
string
The url for the download package. The url will expire after one minute due to security reasons.

Error codes

Code
Message
Explanation
30
Missing mandatory parameter
The request does not contain one or more required parameters. There are at least 3 required parameters for every request: apiKey, signature and action. Other methods may also have extra mandatory parameters. Please check the API Reference for more information.
31
Requests per second limit exceeded
There were too many requests per second made with the same API key.
32
Requests per minute limit exceeded
There were too many requests per minute made with the same API key.
40
Bad request
  • You made a POST request for an API call that is not uploading files.
  • You made a GET request for an API call that uploads files.
  • Your request is incorrectly formatted or the URL is invalid.
41
Invalid credentials
The API key provided in the request is invalid.
42
Invalid action
The API method you specified in the request is incorrect. Please see the API Reference for the list of possible methods.
43
Forbidden
You are not allowed to access the specified collection: it has been deleted or the collection belongs to another user.
44
Invalid signature
The signature you provided is incorrect - it does not match the request.

Example

HTML form example

1
<form method="get" action="https://api.flipsnack.com/v1/">
2
<input type="hidden" name="action" value="collection.downloadHTML">
3
<input type="hidden" name="apiKey" value="LK12NS-0-IOBW3S89VVJH12Z">
4
<input type="hidden" name="collectionHash">
5
<input type="hidden" name="signature" value="2298a6456c1dd2d12b895ce4688ffe31">
6
<button type="submit">Submit</button>
7
</form>
Copied!

Curl example

1
curl -F "action=collection.downloadHTML"\
2
-F "apiKey=LK12NS-0-IOBW3S89VVJH12Z"\
3
-F "collectionHash=d3m0h45h"\
4
-F "signature=2298a6456c1dd2d12b895ce4688ffe31"\
5
https://api.flipsnack.com/v1/
Copied!

Responses

XML

1
<?xml version="1.0" encoding="utf-8"?>
2
<response>
3
<code>20</code>
4
<status>OK</status>
5
<data>
6
<status>COMPLETE</status>
7
<resourceUrl>https://resource.url.example.com/my-collection.zip</resourceUrl>
8
</data>
9
</response>
Copied!

JSON

1
{
2
"code": 20,
3
"status": "OK",
4
"data": {
5
"status": "COMPLETE",
6
"resourceUrl": "resource.url.example",
7
}
8
}
Copied!

JSONP

1
callbackFunctionName({data});
2
// callbackFunctionName is the function name specified by the callback parameter, in the request
3
// the {data} is the actual JSON response
Copied!
Last modified 9mo ago