collection.getEmbed

Returns the embed code for a specified collection based on a set of embed parameters.

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

action (required)

string

The API method that should be called. In this case the value should be collection.getEmbed. 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 embed code. If you do not specify a collection hash, then the request will return the error code "30 - Missing mandatory parameter".

https (DEPRECATED)

boolean

If set to true, the embed code will load the player from our HTTPS location.

Default: true.

responsive

boolean

If set to true, the Flipsnack embed will have the width and height set to 100% and it will take the entire size of the container.

Default: false.

startPage

number

The page number where the flipbook will open automatically.

Default: 1.

startBook (DEPRECATED)

number

The player will automatically open the specified flipbook from the collection.

Default: 1.

width

number

The width of the embed. By default it will have the size specified by the collection width parameter. The collection width can be set when creating a new collection or when editing/updating an existing collection.

height

number

The height of the embed. By default it will have the size specified by the collection height parameter. The collection height can be set when creating a new collection or when editing/updating an existing collection.

Response parameters

Name

Type

Description

embedCode

string

The embed code as requested with the API call: iframe or object embed.

Error codes

For complete list of error codes and messages go to API status codes section.

Examples

Request

# GET
curl -X GET \
     -G \
     https://api.flipsnack.com/v1/ \
     -d action=collection.getEmbed \
     -d apiKey=<YOUR-API-KEY> \
     -d collectionHash=d3m0h45h \
     -d signature=<YOUR-REQUEST-SIGNATURE>

Response

{
    "code": 20,
    "status": "OK",
    "data": {
        "embedCode": "<iframe src=\"\https://player.flipsnack.com/?hash=sample-hash"></iframe>"
    }
}

Last updated