Flipsnack API

collection.getList

Returns a list of collections belonging to your user.

Note: Requests must be made to http://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.getList. If it is not specified, 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.
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.

Note: If you do not specify a collection status, the API will return all collections within the specified range, regardless of their types.
query string A search query to help narrow down search results. This could be a keyword or set of keywords to search through the collection titles or even the hash of the collections.
from number The index of the starting record for the returned list. You can limit the number of results by specifying the index for the first record (parameter from) and the last record (parameter to).

By default, if you do not specify the from and to parameters, the API call returns the first 50 records.

Default: 0.
to number The index of the last record for the returned list. You can limit the number of results by specifying the index for the first record (parameter from) and the last record (parameter to).

By default, if you do not specify the from and to parameters, the API call returns the first 50 records.

Default: 50.
orderBy string The field after which the returned list will be ordered. Possible values are date_published, date_created and name.

Default: date_published.
orderMode string Specifies if the list will be ordered ascending or descending. Possible values are asc and desc.

Default: desc.

Response parameters

Name Type Description
collectionCount string The total number of collections that match the request. This number does not take into consideration the limits specified at the API call.

For example, your request could match 100 collections, but it returns only the ones within the limits specified by from and to parameters.
collections object An object containing the list of collections returned that match the requested criteria. The parameters for each collection are described in the list below.

Collection parameters

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.
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.
createdDate date The date when the collection was created (not necessarily published).
directLink string The public link of the collection.

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.
44 Invalid signature The signature you provided is incorrect - it does not match the request.

Example

HTML form example

<form method="get" action="http://api.flipsnack.com/v1/">
    <input type="hidden" name="action" value="collection.getList">
	<input type="hidden" name="apiKey" value="LK12NS-0-IOBW3S89VVJH12Z">
    <input type="hidden" name="collectionStatus">
	<input type="hidden" name="from">
	<input type="hidden" name="to">
	<button type="submit">Submit</button>
</form>

Curl example

curl -F "action=collection.getList"\
     -F "apiKey=LK12NS-0-IOBW3S89VVJH12Z"\
     -F "collectionStatus=public"\
     -F "from=0"\
     -F "to=2"\
     -F "signature=2298a6456c1dd2d12b895ce4688ffe31"\
     http://api.flipsnack.com/v1/

Responses

<?xml version="1.0" encoding="utf-8"?>
<response>
    <code>20</code>
    <status>OK</status>
    <data>
        <collectionsCount>15</collectionsCount>
        <collections>
            <collection>
                <collectionHash>d3m0h45h</collectionHash>
                <collectionTitle>Lorem ipsum</collectionTitle>
                <collectionStatus>public</collectionStatus>
                <publishDate>2015-06-09 04:50:23</publishDate>
                <createdDate>2015-06-09 04:50:21</createdDate>
                <coverImage>http://files.flipsnack.net/collections/items/913699e80d28331517aee0afci188784/covers/page_1/thumb</coverImage>
                <directLink>http://www.flipsnack.com/user/lorem-ipsum.html</directLink>
            </collection>
            <collection>
                <collectionHash>fdnlg59t</collectionHash>
                <collectionTitle>Official document</collectionTitle>
                <collectionStatus>public</collectionStatus>
                <publishDate>2015-06-09 01:42:39</publishDate>
                <createdDate>2015-06-09 01:42:37</createdDate>
                <coverImage>http://devfiles.flipsnack.net/collections/items/0553278b2fd72f91d88224222i188776/covers/page_1/thumb</coverImage>
                <directLink>http://www.flipsnack.com/user/official-document.html</directLink>
            </collection>
        <collections>
    </data>
</response>
{
    "code": 20,
    "status": "OK",
    "data": {
        "collectionsCount": "15",
        "collections": [
            {
                "collectionHash": "d3m0h45h",
                "collectionTitle": "Lorem ipsum",
                "collectionStatus": "public",
                "publishDate": "2015-06-09 04:50:23",
                "createdDate": "2015-06-09 04:50:21",
                "coverImage": "http://files.flipsnack.net/collections/items/913699e80d28331517aee0afci188784/covers/page_1/thumb",
                "directLink": "http://www.flipsnack.com/user/lorem-ipsum.html"
            },
            {
                "collectionHash": "fdnlg59t",
                "collectionTitle": "Official document",
                "collectionStatus": "public",
                "publishDate": "2015-06-09 01:42:39",
                "createdDate": "2015-06-09 01:42:37",
                "coverImage": "http://files.flipsnack.net/collections/items/0553278b2fd72f91d88224222i188776/covers/page_1/thumb",
                "directLink": "http://www.flipsnack.com/user/official-document.html"
            }
        ]
    }
}
callbackFunctionName({data});
// callbackFunctionName is the function name specified by the callback parameter, in the request
// the {data} is the actual JSON response