Skip to main content

API Reference

Explore the Bannersnack API Reference. Learn how to use methods like create-banner, edit-banner, and get-banner-urls with request parameters, response codes, and examples to integrate seamlessly.

Updated this week

Select one of the API methods in the right sidebar to see information about it: request parameters, response and error codes. Each method has an example on how to use it and examples for each type of response.

1. create-banner

Returns the Bannersnack editor URL.

Note: Requests must be made to http://www.bannersnack.com/wapi/2.0/ or http://your-domain/wapi/2.0/.

Request parameters

Name

Type

Description

client_id (required)

string

The client_id parameter is required for authentication. We associate the user with the client ID provided. Find out how can you obtain your client ID.

signature (required)

string

The signature must be calculated by you and added to the request. See How to sign a request for more information.

action (required)

string

The API method that should be called. In this case the value should be create-banner.

t (required)

timestamp

Specifies the current timestamp in seconds.

identifier (required)

string

A unique identifier for every user.
Examples: [email protected], 2AF832 etc.

name

string

User's name.

multiple_slides

integer

Possible values:

  • 0 - if you want your user to be allowed to create banners with multiple slides

  • 1 - if you don't want your user to be able to create banners with multiple slides


This value can be set in the admin panel, but if you specify it in the request, the setting from admin panel will be overwritten.

animations

integer

Possible values:

  • 0 - if you want your user to be allowed to create banners with animations

  • 1 - if you don't want your user to be able to create banners with animations


This value can be set in the admin panel, but if you specify it in the request, the setting from the admin panel will be overwritten.

cancel_url

string

If specified, there will be a "Close banner maker" link in the editor which, if clicked, will redirect the user to the specified link.

This value can be set in the admin panel, but if you specify it in the request, the setting from the admin panel will be overwritten.

use_banner_url

string

If specified, it will redirect the user to the specified link upon banner Save.

This value can be set in the admin panel, but if you specify it in the request, the setting from the admin panel will be overwritten.

mode

string

Possible values:

  • redirect (default) - the values set for close_url and use_banner_url will be used and the page will redirect to specified url's when these actions are called. Returns error if use_banner_url and close_url are not set.

  • iframe - if the iframe mode is set then the close_url and use_banner_url will be ignored and we will send messages through postMessage to the parent (see bellow) and you should handle the forward actions
    window.parent.postMessage("BS.closeBannerEditor", "*");
    window.parent.postMessage("BS.useBanner:" + bannerHash, "*");

from

string

Requires a banner hash.
If specified, the returned URL will open the Bannersnack editor with that banner loaded, like a template.

Note: The banner with the given hash will not be modified, but a new banner will be generated instead.

width, height

integer

If provided, the editor will load a blank banner with the specified width and height. Maximum value is 3000 and minimum value is 10.

Response parameters

If the request is successful the API will return a json object with 2 keys.

Name

Type

Description

code

integer

The code will indicate the status of your request.
code 200 represents a successful response.

url

string

The URL to the Bannersnack editor.

Example

Curl example

curl -F "client_id=2AF832"\ -F "action=create-banner"\ -F "t=1461758852"\ -F "[email protected]"\ -F "name=Name"\ -F "animations=1"\ -F "use_banner_url=http://www.bannersnack.com"\ -F "signature=0a85db3d41d0b432465d2c5d33d2937904f4ec32"\ http://www.bannersnack.com/wapi/2.0/

2. create-bannerset

Returns the Bannersnack generator URL.

Note: Requests must be made to http://www.bannersnack.com/wapi/2.0/ or http://your-domain/wapi/2.0/.

Request parameters

Name

Type

Description

client_id (required)

string

The client_id parameter is required for authentification. We associate the user to the client ID provided. Find out how can you obtain your client ID.

signature (required)

string

The signature must be calculated by you and added to the request. See How to sign a request for more information.

action (required)

string

The API method that should be called. In this case the value should be create-bannerset.

t (required)

timestamp

Specifies the current timestamp in seconds.

identifier (required)

string

A unique identifier for every user.
Examples: [email protected], 2AF832 etc.

name

string

User's name.

animations

integer

Posible values:

  • 0 - if you want your user to be allowed to create banners with animations

  • 1 - if you don't want your user to create banners with animations


This value can be set in admin panel, but if you specify it in the request, the setting from admin panel will be overwritten.

cancel_url

string

If specified, there will be a "Close banner maker" link in generator which, if clicked, will redirect the user to the specified link.

This value can be set in admin panel, but if you specify it in the request, the setting from admin panel will be overwritten.

use_banner_url

string

If specified, there will be a "Use this banner" button for each banner in the banners list which, if clicked, will redirect the user to the specified link along with the banner hash.

This value can be set in admin panel, but if you specify it in the request, the setting from admin panel will be overwritten.

mode

string

Posible values:

  • redirect (default) - the values set for close_url and use_banner_url will be used and the page will redirect to specified urls when these actions are called

  • iframe - if the iframe mode is set then the close_url and use_banner_url will be ignored and we will send messages through postMessage to the parent (see bellow) and you should handle the forward actions
    window.parent.postMessage("BS.closeBannerEditor", "*");
    window.parent.postMessage("BS.useBanner:" + bannerHash, "*");

from_bannerset

string

Requires a bannerset hash.
If specified, the returned URL will open the Bannesnack generator with that bannerset loaded, like a template.

Note: The bannerset with the given hash will not be modified, a new bannerset will be generated instead.

Response parameters

If the request is successful the API will return a json object with 2 keys.

Name

Type

Description

code

integer

The code will indicate the status of your request.
code 200 represents an successful response.

url

string

The URL to the Bannersnack generator.

Example

Curl example

curl -F "client_id=2AF832"\ -F "action=create-bannerset"\ -F "t=1461758852"\ -F "[email protected]"\ -F "name=Name"\ -F "animations=1"\ -F "use_banner_url=http://www.bannersnack.com"\ -F "signature=0a85db3d41d0b432465d2c5d33d2937904f4ec32"\ http://www.bannersnack.com/wapi/2.0/

Response example

{ code: 200, data: { url: "www.your-domain.com/banner-creator/generator/?UA_PHPSESSID=9ad00a24a36cb816cb166wc9ff89c95b" } }

3. edit-banner

Returns the Bannersnack editor URL with the requested banner loaded for edit.

Note: Requests must be made to http://www.bannersnack.com/wapi/2.0/ or http://your-domain/wapi/2.0/.

Request parameters

Name

Type

Description

client_id (required)

string

The client_id parameter is required for authentification. We associate the user to the client ID provided. Find out how can you obtain your client ID.

signature (required)

string

The signature must be calculated by you and added to the request. See How to sign a request for more information.

action (required)

string

The API method that should be called. In this case the value should be edit-banner.

t (required)

timestamp

Specifies the current timestamp in seconds.

identifier (required)

string

A unique identifier for every user.
Examples: [email protected], 2AF832 etc.

banner_hash
(required)

string

The hash of the banner to be edited.
Examples: bh3yhqam, t5j4hjvk, etc.

Response parameters

If the request is successful the API will return a json object with 2 keys.

Name

Type

Description

code

integer

The code will indicate the status of your request.
code 200 represents an successful response.

url

string

The URL to the Bannersnack editor with the requested banner loaded for editing.

Example

Curl example

curl -F "client_id=2AF832"\ -F "action=edit-banner"\ -F "t=1461758852"\ -F "[email protected]"\ -F "banner_hash=bh3yhqam"\ -F "signature=0a85db3d41d0b432465d2c5d33d2937904f4ec32"\ http://www.bannersnack.com/wapi/2.0/

4. edit-bannerset

Returns the Bannersnack generator URL with the requested banner loaded for edit.

Note: Requests must be made to http://www.bannersnack.com/wapi/2.0/ or http://your-domain/wapi/2.0/.

Request parameters

Name

Type

Description

client_id (required)

string

The client_id parameter is required for authentification. We associate the user to the client ID provided. Find out how can you obtain your client ID.

signature (required)

string

The signature must be calculated by you and added to the request. See How to sign a request for more information.

action (required)

string

The API method that should be called. In this case the value should be edit-bannerset.

t (required)

timestamp

Specifies the current timestamp in seconds.

identifier (required)

string

A unique identifier for every user.
Examples: [email protected], 2AF832 etc.

bannerset_hash
(required)

string

The hash of the bannerset to be edited.
Examples: bh3yhqam, t5j4hjvk, etc.

Response parameters

If the request is successful the API will return a json object with 2 keys.

Name

Type

Description

code

integer

The code will indicate the status of your request.
code 200 represents an successful response.

url

string

The URL to the Bannersnack generator with the requested banner loaded for editing.

Example

Curl example

curl -F "client_id=2AF832"\ -F "action=edit-bannerset"\ -F "t=1461758852"\ -F "[email protected]"\ -F "bannerset_hash=bh3yhqam"\ -F "signature=0a85db3d41d0b432465d2c5d33d2937904f4ec32"\ http://www.bannersnack.com/wapi/2.0/

Curl example

{ code: 200, data: { url: "www.your-domain.com/banner-creator/generator/edit/?hash=btn365ic&UA_PHPSESSID=f969fd314b7861078b9542a2e3a9d8ed" } }

5. get-banner-urls

Returns the requested banner urls. Once the request was completed and the banner files are generated the status will be displayed as 'done', otherwise it will be displayed as 'pending'.

Note: Requests must be made to http://www.bannersnack.com/wapi/2.0/ or http://your-domain/wapi/2.0/.

Request parameters

Name

Type

Description

client_id (required)

string

The client_id parameter is required for authentification. We associate the user to the client ID provided. Find out how can you obtain your client ID.

signature (required)

string

The signature must be calculated by you and added to the request. See How to sign a request for more information.

action (required)

string

The API method that should be called. In this case the value should be get-banner-urls.

t (required)

timestamp

Specifies the current timestamp in seconds.

banner_hash (required)

string

The banner hash to get urls for.

Response parameters

If the request is successful the API will return an array with 3 objects. Each object will have the following parameters:

Name

Type

Description

type

string

The type of file for which the url is returned.

  • jpg

  • png

  • html5

  • mp4

  • pdf

  • pdf-print

  • animated-gif

  • optimized-animated-gif

url

string

The URL to the banner.

status

string

The status of the banner

  • none - if the banner files are not generated

  • pending - if the banner files are not generated yet

  • done - if the banner files are generated

Error codes

Code

Message

Explanation

510

The request has expired

The request couldn't be completed. Check your server datetime.

511

Maintenance mode

The API servers have entered in maintenance mode and cannot complete any requests. In this case you should try again later.

512

Client id not found

Given Client ID is not found in the database.

513

Invalid signature

The signature you provided is incorrect - it does not match the request.

514

Bad request

Your request is incorrectly formatted or cannot be otherwise served.

515

Disabled domain

The domain you requested is disabled. You are not allowed to access the specified domain.

520

Missing mandatory parameter

The request does not contain one or more required parameters. There are 5 required parameters for this request: client_id, signature, action, banner_hash and t.

521

Internal server error

An error occurred on the server and the request could not be completed. In this case you should resend the request after a few seconds. If the request still fails after several attempts, please contact us.

531

Banner not found

You are trying to access a banner that does not exist or you don't have access to it.

Example

Curl example

curl -F "client_id=2AF832"\ -F "action=get-banner-urls"\ -F "t=1461758852"\ -F "banner_hash=ihagcdk4"\ -F "signature=0a85db3d41d0b432465d2c5d33d2937904f4ec32"\ http://www.bannersnack.com/wapi/2.0/

6. get-bannerset-urls

Returns the requested bannerset urls. Once the request was completed and the banner files are generated the status will be displayed as 'done', otherwise it will be displayed as 'pending'.

Note: Requests must be made to http://www.bannersnack.com/wapi/2.0/ or http://your-domain/wapi/2.0/.

Request parameters

Name

Type

Description

client_id (required)

string

The client_id parameter is required for authentification. We associate the user to the client ID provided. Find out how can you obtain your client ID.

signature (required)

string

The signature must be calculated by you and added to the request. See How to sign a request for more information.

action (required)

string

The API method that should be called. In this case the value should be get-bannerset-urls.

t (required)

timestamp

Specifies the current timestamp in seconds.

bannerset_hash (required)

string

The bannerset hash to get urls for.

Response parameters

If the request is successful the API will return an array with objects. Each object will have the following parameters:

Name

Type

Description

bannerHash

string

The hash of the banner from bannerset.
Examples: bh3yhqam, t5j4hjvk, etc.

urls

array

An array with 3 objects. Each object will have the following parameters:

typestringThe type of file for which the url is returned.

  • jpg

  • png

  • html5

urlstringThe URL to the banner.statusstringThe status of the banner

  • done - if the banner files are generated

  • pending - if the banner files are not generated yet

Error codes

Code

Message

Explanation

510

The request has expired

The request couldn't be completed. Check your server datetime.

511

Maintenance mode

The API servers have entered in maintenance mode and cannot complete any requests. In this case you should try again later.

512

Client id not found

Given Client ID is not found in the database.

513

Invalid signature

The signature you provided is incorrect - it does not match the request.

514

Bad request

Your request is incorrectly formatted or cannot be otherwise served.

515

Disabled domain

The domain you requested is disabled. You are not allowed to access the specified domain.

520

Missing mandatory parameter

The request does not contain one or more required parameters. There are 5 required parameters for this request: client_id, signature, action, bannerset_hash and t.

521

Internal server error

An error occurred on the server and the request could not be completed. In this case you should resend the request after a few seconds. If the request still fails after several attempts, please contact us.

531

Banner not found

You are trying to access a banner that does not exist or you don't have access to it.

Example

Curl example

curl -F "client_id=2AF832"\ -F "action=get-bannerset-urls"\ -F "t=1461758852"\ -F "bannerset_hash=ihagcdk4"\ -F "signature=0a85db3d41d0b432465d2c5d33d2937904f4ec32"\ http://www.bannersnack.com/wapi/2.0/

Response example

{ code: 200, data: [ { bannerHash: "bduny9j1", urls: [ { type: "jpg", url: "https://s3.amazonaws.com/files/banners/bduny9j1/images/jpg", status: "done" }, { type: "png", url: "https://s3.amazonaws.com/files/banners/bduny9j1/images/png", status: "done" }, { type: "html5", url: "http://exporthtml5.bannersnack.com/save/?hash=bduny9j1&key=86f154241c36b08ed4140568b6759f3c", status: "done" } ] }, { bannerHash: "btjig85k", urls: [ { type: "jpg", url: "https://s3.amazonaws.com/files/banners/btjig85k/images/jpg", status: "done" }, { type: "png", url: "https://s3.amazonaws.com/files/banners/btjig85k/images/png", status: "done" }, { type: "html5", url: "http://exporthtml5.bannersnack.com/save/?hash=btjig85k&key=c79a86d27c3988f5abe91d6311f0d07a", status: "done" } ] }, { bannerHash: "bdcj2m9t", urls: [ { type: "jpg", url: "https://s3.amazonaws.com/files/banners/bdcj2m9t/images/jpg", status: "done" }, { type: "png", url: "https://s3.amazonaws.com/files/banners/bdcj2m9t/images/png", status: "done" }, { type: "html5", url: "http://exporthtml5.bannersnack.com/save/?hash=bdcj2m9t&key=6aca5af1c25ecac5b99a1dc922ce757a", status: "done" } ] }, { bannerHash: "bt95bf8p", urls: [ { type: "jpg", url: "https://s3.amazonaws.com/files/banners/bt95bf8p/images/jpg", status: "done" }, { type: "png", url: "https://s3.amazonaws.com/files/banners/bt95bf8p/images/png", status: "done" }, { type: "html5", url: "http://exporthtml5.bannersnack.com/save/?hash=bt95bf8p&key=a2871e2e2730ecaa56a6748724893f29", status: "done" } ] } }

7. get-user-banners

Returns a banner or a list of banners from a specific user.

Note: Requests must be made to http://www.bannersnack.com/wapi/2.0/ or http://your-domain/wapi/2.0/.

Request parameters

Name

Type

Description

client_id (required)

string

The client_id parameter is required for authentification. We associate the user to the client ID provided. Find out how can you obtain your client ID.

signature (required)

string

The signature must be calculated by you and added to the request. See How to sign a request for more information.

action (required)

string

The API method that should be called. In this case the value should be get-user-banners.

t (required)

timestamp

Specifies the current timestamp in seconds.

identifier (required)

string

A unique identifier for every user.
Examples: [email protected], 2AF832 etc.

type

string

Banner type, one of: bannersets, banners(default) or all.

bannerset_hash

string

The bannerset hash.

Response parameters

If the request is successful the API will return an array with banners. Each banner will have the following objects:

Name

Type

Description

bannerHash

string

The hash of the banner that has been found.

name

string

The name of the banner.

image

string

The path of the banner.

dateCreated

timestamp

The date when the banner was created.

dateLastUpdate

timestamp

The last date when the banner was updated.

width

integer

The width of the banner.

height

integer

The height of the banner.

type

string

The type of the banner: bannerset or banner

numberOfBanners

string

The number of the banners from bannerset or null if the type is banner.

animated

bool

Returns true if the banner is animated.

exports

array

List of generated exports.

Error codes

Code

Message

Explanation

510

The request has expired

The request couldn't be completed. Check your server datetime.

511

Maintenance mode

The API servers have entered in maintenance mode and cannot complete any requests. In this case you should try again later.

512

Client id not found

Given Client ID is not found in the database.

513

Invalid signature

The signature you provided is incorrect - it does not match the request.

514

Bad request

Your request is incorrectly formatted or cannot be otherwise served.

515

Disabled domain

The domain you requested is disabled. You are not allowed to access the specified domain.

520

Missing mandatory parameter

The request does not contain one or more required parameters. There are 5 required parameters for this request: client_id, signature, action, identifier and t.

521

Internal server error

An error occurred on the server and the request could not be completed. In this case you should resend the request after a few seconds. If the request still fails after several attempts, please contact us.

534

Identifier not found

You are trying to access banners from an identifier that does not exist.

Example

Curl example

curl -F "client_id=2AF832"\ -F "action=get-user-banners"\ -F "t=1461758852"\ -F "[email protected]"\ -F "signature=0a85db3d41d0b432465d2c5d33d2937904f4ec32"\ http://www.bannersnack.com/wapi/2.0/

8. start-banner-export

Returns the status of the request.

Note: Requests must be made to http://www.bannersnack.com/wapi/2.0/ or http://your-domain/wapi/2.0/.

Request parameters

Name

Type

Description

client_id (required)

string

The client_id parameter is required for authentification. We associate the user with the client ID provided. Find out how can you obtain your client ID.

signature (required)

string

The signature must be calculated by you and added to the request. See How to sign a request for more information.

action (required)

string

The API method that should be called. In this case the value should be start-banner-export.

t (required)

timestamp

Specifies the current timestamp in seconds.

banner_hash (required)

string

The banner hash.

type (required)

string

Export type, one of: mp4, pdf, pdf-print, animated-gif or optimized-animated-gif.

Response parameters

If the request is successful the API will return an object containing the status of the request

Name

Type

Description

status

string

The status of the request

  • done - if the request has been successfully made

Error codes

Code

Message

Explanation

510

The request has expired

The request couldn't be completed. Check your server datetime.

511

Maintenance mode

The API servers have entered in maintenance mode and cannot complete any requests. In this case you should try again later.

512

Client id not found

Given Client ID is not found in the database.

513

Invalid signature

The signature you provided is incorrect - it does not match the request.

514

Bad request

Your request is incorrectly formatted or cannot be otherwise served.

515

Disabled domain

The domain you requested is disabled. You are not allowed to access the specified domain.

520

Missing mandatory parameter

The request does not contain one or more required parameters. There are 5 required parameters for this request: client_id, signature, action, banner_hash and t.

521

Internal server error

An error occurred on the server and the request could not be completed. In this case you should resend the request after a few seconds. If the request still fails after several attempts, please contact us.

530

Invalid format type

The resource you are trying to access must have a valid format.

531

Banner not found

You are trying to access a banner that does not exist or you don't have access to it.

Example

Curl example

curl -F "client_id=2AF832"\ -F "action=start-banner-export"\ -F "t=1461758852"\ -F "banner_hash=ihagcdk4"\ -F "type=mp4"\ -F "signature=0a85db3d41d0b432465d2c5d33d2937904f4ec32"\ http://www.bannersnack.com/wapi/2.0/

Ready to start designing?

👉 Sign up for a free Bannersnack account – it only takes a minute.
👉 Already have an account? Log in here to continue where you left off.

Did this answer your question?