collection.getCollection
Returns information about a collection. The information contains configuration parameters for the widget and the list of collection items.
Note: Requests must be made to https://api.flipsnack.com/v1.
You can also use this method at regular time intervals to check if an uploaded document has finished converting. This could be done right after a collection.create method call. If the document's status is either complete or failed, you can stop checking its status.

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.getCollection. If it is not specified, the request will return the error code "30 - Missing mandatory parameter".
collectionHash (required)
string
The hash of the collection you wish to update. 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

If the upload is successful, the API call returns information about the collection which was just created.
Name
Type
Description
collectionHash
string
The hash for the newly created collection. If the collection status is editable the generated hash will be temporary. Once the collection is published, a new, final hash will be generated for it.
collectionTitle
string
The title of the collection.
collectionDescription
string
The description of the collection. It can be specified in the creation parameters or generated by the conversion system.
collectionStatus
string
The current status of the collection: public, editable or unlisted.
coverImage
string
The url of the collection's thumbnail image. This thumbnail is generated from the first page of the first collection item.
collectionPageCount
number
The number of pages in the collection, for all the collection items.
createdDate
date
The date when the collection was created (not necessarily published).
publishDate
date
The date when the collection was published.
directLink
string
The public link of the collection.
flipbookPageCount
number
The number of pages of the collection item. For collections created with the API, collectionPageCount and flipbookPageCount should have the same value.
flipbookStatus
string
The status of the flipbook. Possible values are
  • processing: the document is still converting;
  • complete: the document was converted successfully;
  • failed: the conversion process failed.
Converting a PDF document is a time consuming process. You can check the status of a flipbook at a few seconds intervals by using the collection.getCollection method. The requests to collection.getCollection should be made until the flipbook has completed or failed converting.
settings
object
An object containing the configuration parameters of the collection, as set from the API call. See the list below.
collectionItems
array
The list of collection items belonging to the collection. In case of collections created using the API, the list contains a single item. The parameters of the collection item are listed below.

Configuration parameters

Name
Type
Description
collectionWidth
number
The embed width of the widget (measured in pixels).
collectionHeight
number
The embed height of the widget (measured in pixels).
collectionStatus
string
The type of collection. Possible values are public, editable and unlisted. Public collections are listed on your public profile and in search results. They are publicly available to other users. Editable collections are not published. They must be published manually from the Flipsnack editor or updated using the collection.update method. Unlisted collections are published but not listed on your profile page and in search results. Other users may view them only if they receive a direct link or an embedded widget from you.
enableDownload
boolean
If set to true, displays the download button in the flash widget menu. The menu is displayed only when the widget is in fullscreen.
enableFullScreen
boolean
If set to true, allows the Flash widget to enter fullscreen mode: a "Click to read" button is displayed.
enableSearch
boolean
If set to true, displays the search button in the flash widget menu. If there is no text to search within the current collection item, the search button is displayed as disabled.
tooltipsLanguage
string
Selects the language for the tooltips displayed in the flash widget. Possible languages are: Basque, Bosanski, Català, Czech, Dansk, Deutsch, English, Español, כשר, Française, ελληνικά, Hrvatski, Indonesian, Italiano, Magyar, Nederlands, Nederlands, Norsk, Polski, Português, Português do Brasil, Română, Pусский, Cрпски, Slovene, Suomi, Slovak, Swedish, Turkish.
transparentBackground
boolean
If set to true, the widget is displayed with no background.
backgroundColor
string
The background color of the widget, specified as a hexadecimal value. If the transparentBackground is set to true, the widget will ignore the backgroundColor parameter.
backgroundScaleType
string
The scale mode of images used as background for the widget. Possible values are scaleCrop, center and tile. Background images can be set using the collection.setBackgroundImage method.
autoFlip
boolean
If set to true, allows the widget to automatically turn the pages of the flipbook. The pages turn after a time specified by the autoFlipDelay parameter.
autoFlipDelay
number
Specifies the time in seconds for pages to turn automatically. If autoFlip is false, this parameter is ignored.
rightToLeftOrientation
boolean
If set to true, allows the flipbook to be viewed from right to left: the first page is starts from the end as viewed in normal mode. This option is useful for documents written in right to left languages.
singlePageView
boolean
If set to true, allows the flipbook to be viewed a single page at a time.
logoUrl
string
The URL of the logo image. A logo image can be set only by uploading it with the collection.setLogo method.
shareFacebook
boolean
If set to true, the Flash widget displays a Facebook sharing option in the widget menu, in fullscreen mode.
shareTwitter
boolean
If set to true, the Flash widget displays a Twitter sharing option in the widget menu, in fullscreen mode.
shareGooglePlus
boolean
If set to true, the Flash widget displays a Google+ sharing option in the widget menu, in fullscreen mode.
sharePinterest
boolean
If set to true, the Flash widget displays a Pinterest sharing option in the widget menu, in fullscreen mode.
shareEmail
boolean
If set to true, the Flash widget displays an email sharing option in the widget menu, in fullscreen mode.
shareLinkText
string
The link opened from the link sharing option, within the widget. By default, this link is the direct link of the collection.

Collection item 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 3required 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 APIReference 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.
46
Invalid collection hash
You are trying to access a collection that does not exist.

Example

HTML form example

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

Curl example

1
curl -F "action=collection.getCollection"\
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
<collectionHash>d3m0h45h</collectionHash>
7
<collectionTitle>Lorem ipsum</collectionTitle>
8
<collectionStatus>published</collectionStatus>
9
<coverImage>https://files.flipsnack.net/collections/items/7c5e600d4459fe4e04d23ae5ei188777/covers/page_1/medium</coverImage>
10
<directLink>https://www.flipsnack.com/user/lorem-ipsum-d3m0h45h.html</directLink>
11
<createdDate>2015-06-09 01:43:05</createdDate>
12
<publishDate>2015-06-09 01:43:07</publishDate>
13
<collectionPageCount>2</collectionPageCount>
14
<collectionItems>
15
<collectionItem>
16
<flipbookHash>7c5e600d4459fe4e04d23ae5ei188777</flipbookHash>
17
<flipbookPageCount>2</flipbookPageCount>
18
<flipbookTitle>Lorem ipsum</flipbookTitle>
19
<flipbookDescription>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</flipbookDescription>
20
<extension>pdf</extension>
21
<convertStatus>COMPLETE</convertStatus>
22
</collectionItem>
23
</collectionItems>
24
<settings>
25
<collectionWidth>640</collectionWidth>
26
<collectionHeight>385</collectionHeight>
27
<enableFullScreen>true</enableFullScreen>
28
</settings>
29
</data>
30
</response>
Copied!

JSON

1
{
2
"code": 20,
3
"status": "OK",
4
"data": {
5
"collectionHash": "d3m0h45h",
6
"collectionTitle": "Lorem ipsum",
7
"collectionStatus": "published",
8
"coverImage": "https://files.flipsnack.net/collections/items/7c5e600d4459fe4e04d23ae5ei188777/covers/page_1/medium",
9
"directLink": "https://www.flipsnack.com/user/lorem-ipsum-d3m0h45h.html",
10
"createdDate": "2015-06-09 01:43:05",
11
"publishDate": "2015-06-09 01:43:07",
12
"collectionPageCount": 2,
13
"collectionItems": [
14
{
15
"flipbookHash": "7c5e600d4459fe4e04d23ae5ei188777",
16
"flipbookPageCount": "2",
17
"flipbookTitle": "Lorem ipsum",
18
"flipbookDescription": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
19
"extension": "pdf",
20
"convertStatus": "COMPLETE"
21
}
22
],
23
"settings": {
24
"collectionWidth": "640",
25
"collectionHeight": "385",
26
"enableFullScreen": "true"
27
}
28
}
29
}
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