flipbook.add (DEPRECATED)
This method is DEPRECATED.
Uploads a new PDF document to an already existing collection.
Note: Requests must be made to https://upload.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 flipbook.add. If it is not specified, the request will return the error code "30 - Missing mandatory parameter".
collectionHash (required)
string
The hash of the collection to which the new flipbook will be added. If it is not specified, the request will return the error code "30 - Missing mandatory parameter".
file (required)
file
The PDF document that should be uploaded.
Documents can be uploaded either using a local file, through the file parameter, or from an external URL, using the fileUrl parameter. You must specify at least one of them. If both parameters are specified, the API will take into consideration only the file parameter.
If neither file or fileUrl are specified the request will return the error code "30 - Missing mandatory parameter". Also, file uploads are bound to API limitations, which allow only PDF files of maximum 100 MB and 500 pages.
fileUrl (required)
string
The URL of a PDF document.
Documents can be uploaded either using a local file, through the file parameter, or from an external URL, using the fileUrl parameter. You must specify at least one of them. If both parameters are specified, the API will take into consideration only the file parameter.
If neither file or fileUrl are specified the request will return the error code "30 - Missing mandatory parameter". Also, file uploads are bound to API limitations, which allow only PDF files of maximum 100 MB and 500 pages.
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.
title
string
The title of the flipbook. If it is not specified, the title will be automatically extracted from the document.
description
string
The description of the flipbook. If it is not specified, the application will automatically fill in the description with information extracted from the document.

Response parameters

Name
Type
Description
flipbookHash
string
The hash generated for the collection item.
flipbookPageCount
number
The number of pages of the collection item.
flipbookTitle
string
The title of the flipbook.
flipbookDescription
string
The description of the flipbook.
extension
string
The extension of the document that the flipbook is based on. Extensions can be pdf, jpg or png.
convertStatus
string
The status of the flipbook specifies if it has finished converting or if it is still in the process of conversion. Possible values are PROCESSING, FAILED and COMPLETE.

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.
33
Uploads per month exceeded
You have exceeded the maximum number of uploads allowed per month.
34
File size too large
The file you have uploaded has a size that exceeds the maximum file size allowed. For more information please see the limitations imposed by the API.
35
Collection maximum pages number exceeded
You have uploaded a document that exceeds the maximum of 500 pages allowed. For more information please see the limitations imposed by the API.
36
Multiple files upload not allowed
Flipsnack API allows only one file per upload request. Upload requests are made via the collection.create, collection.setLogo, collection.setBackgroundImage and flipbook.add .
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.
45
Invalid file format
The file you are trying to upload has an incorrect file type. For more information please see the limitations imposed by the API.

Example

HTML form example

1
<form method="post" action="https://upload.flipsnack.com/v1/" enctype="multipart/form-data">
2
<input type="hidden" name="action" value="flipbook.add">
3
<input type="hidden" name="apiKey" value="LK12NS-0-IOBW3S89VVJH12Z">
4
<input type="text" name="collectionHash">
5
<input type="text" name="title">
6
<input type="file" name="file">
7
<button type="submit">Submit</button>
8
</form>
Copied!

Curl example

1
curl -F "action=flipbook.add"\
2
-F "apiKey=LK12NS-0-IOBW3S89VVJH12Z"\
3
-F "collectionHash=d3m0h45h"\
4
-F "title=Second doc"\
5
-F "[email protected]\"/mydocs/document2.pdf\";filename=\"document2.pdf\""\
6
-F "signature=2298a6456c1dd2d12b895ce4688ffe31"\
7
https://upload.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
<flipbookHash>da8637256a0276f13999204f5f1i462s</flipbookHash>
7
<flipbookTitle>Second doc</flipbookTitle>
8
<extension>pdf</extension>
9
<convertStatus>COMPLETE</convertStatus>
10
</data>
11
</response>
Copied!

JSON

1
{
2
"code": 20,
3
"status": "OK",
4
"data": {
5
"flipbookHash": "da8637256a0276f13999204f5f1i462s",
6
"flipbookTitle": "Second doc",
7
"extension": "pdf",
8
"convertStatus": "COMPLETE"
9
}
10
}
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 8mo ago