collection.update
Updates the settings of an existing collection.
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.update. 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.
title
string
The title of the collection. This title will appear on the collection's direct link and in the My Collections page. By default, if a title is not given, Flipsnack will try to extract the title from the uploaded document.
description
string
The description of the collection. By default, during the conversion process, Flipsnack extracts the first few words from the document. You can overwrite that description with yours, using this parameter.
collectionWidth
number
The embed width of the widget (measured in pixels). Default: 650.
collectionHeight
number
The embed height of the widget (measured in pixels). Default: 385.
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 have their status 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. Note: Once a collection receives the public status, it cannot be changed to unlisted, even if the current status is set to editable. But unlisted collections can be changed to public collections. Default: public.
enableThumbView
boolean
If set to true, displays the thumbnail viewer in the Adobe Flash widget. The thumbnail viewer is displayed only when the Flash widget is in fullscreen. Default: true.
enableToc
boolean
If set to true and if the pdf has a table of contents the widget will display it. Default: false.
showControls
boolean
If set to true, then the navigation controls will be displayed in normal mode Default: false.
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. Default: true.
enablePrint
boolean
If set to true, displays the print button in the widget menu. The menu is displayed when the widget is in fullscreen. Default: true.
enableFullScreen
boolean
If set to true, allows the Flash widget to enter fullscreen mode: a "Click to read" button is displayed. Default: true.
enableSearch
boolean
If set to true, displays the search button in the flash widget menu. The menu is displayed only when the widget is in fullscreen. If there is no text to search within the current collection item, the search button is displayed, but disabled. Default: true.
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. Default: English.
background
string
The background color of the widget. Possible values are color and transparent. If set to transparent, the widget is displayed with no background. Background color value can be set using the color parameter, explained below. Default: color.
color
string
The background color of the widget, specified as a hexadecimal value. If the background is set to transparent, the widget will ignore the color parameter. Default: 444444.
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. Default: scaleCrop.
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. Default false.
autoFlipDelay
number
Specifies the time in seconds for pages to turn automatically. If autoFlip is false, this parameter is ignored. Default: 6.
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. Default: false.
singlePageView
boolean
If set to true, allows the flipbook to be viewed a single page at a time. Default: false.
logoUrl
string
The URL of the logo image. A logo image can be set only by uploading it with the collection.setLogo method.

Response parameters

If the request is successful, the API call returns information about the specified collection.
This action method has the same response as collection.getCollection method.

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.
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.update">
3
<input type="hidden" name="apiKey" value="LK12NS-0-IOBW3S89VVJH12Z">
4
<input type="text" name="title">
5
<input type="text" name="width">
6
<input type="text" name="height">
7
<button type="submit">Submit</button>
8
</form>
Copied!

Curl example

1
curl -F "action=collection.update"\
2
-F "apiKey=LK12NS-0-IOBW3S89VVJH12Z"\
3
-F "title=Lorem ipsum dolor"\
4
-F "width=800"\
5
-F "height=600"\
6
-F "signature=2298a6456c1dd2d12b895ce4688ffe31"\
7
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 dolor</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.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>800</collectionWidth>
26
<collectionHeight>600</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 dolor",
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.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": "800",
25
"collectionHeight": "600",
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