Snaps

This is the main feature of SnapsBrew, this is the one feature that will let you automate your marketing to levels you've never seen. Now you can say good bye to spending tons of hours designing, editing and copying and pasting the same design over an over for a hundred products. Just use one of SnapsBrew tailored designs, make an API call to SnapsBrew with a link to the image you want to reuse and voilá! A thousand custom images in just a few minutes.

The Snap model

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the Snap.

  • Name
    template_id
    Type
    string
    Description

    The id of the template from which this snap was taken.

  • Name
    type
    Type
    string
    Description

    The type of the snap: image, pdf.

  • Name
    media_url
    Type
    string
    Description

    The url where the snap is stored.

  • Name
    variants
    Type
    array
    Description

    An array of Variant objects that overwrites the layers of the template selected.

  • Name
    created_at
    Type
    timestamp
    Description

    Timestamp of when the conversation was created.

Snap model

{
  "id": "73824855-47b0-421d-be7d-e238ebfbfe29",
  "template_id": "141e8454-8aa1-420a-bd0b-18a85ba949a2",
  "type": "image",
  "variants": [
    {
      "layer": "review_poster",
      "image_url": "https://snapsbrew.com/crazy-doc-brown-jailed"
    },
    {
      "layer": "review_title",
      "text": "The worst Time-Travel movie ever made"
    },
    {
      "layer": "reviewer_handle",
      "text": "@grumpyTraveler"
    }
  ],
  "media_url": "https://snapsbrew.com/storage/43/conversions/media-librarywE0C8F-image.jpg",
  "created_at": "1985-10-15:18:38.000000Z"
}

GEThttps://snapsbrew.com/v1/snaps

List all snaps

This endpoint will allow you to make a GET request to get a list of the snaps that have been created. This endpoint doesn't have any required fields but you certainly need to add a few to travel trough the paginated list.

Optional attributes

  • Name
    cursor
    Type
    string
    Description

    Cursor position of the paginated response.

  • Name
    pagination
    Type
    integer
    Description

    The items quantity returned in each response page. Defaults to 15

Request

GET
https://snapsbrew.com/api/v1/snaps
{
  "cursor": "1041afe7-b9c3-42ef-8530-6910bb486e76"
}

Response

{
  "items": [
    {
      "id": "73824855-47b0-421d-be7d-e238ebfbfe29",
      "template_id": "141e8454-8aa1-420a-bd0b-18a85ba949a2",
      "type": "image",
      "variants": [
        {
          "layer": "review_poster",
          "image_url": "https://snapsbrew.com/crazy-doc-brown-jailed"
        },
        {
          "layer": "review_title",
          "text": "The worst Time-Travel movie ever made"
        },
        {
          "layer": "reviewer_handle",
          "text": "@grumpyTraveler"
        }
      ],
      "media_url": "https://snapsbrew.com/storage/43/conversions/media-librarywE0C8F-image.jpg",
      "created_at": "1985-10-15:18:38.000000Z"
    },
    {
      "id": "73824855-47b0-421d-be7d-e238ebfbfe29",
      // ...
    }
  ],
  "metadata": {
    "items_per_page": 15,
    "next_page_cursor": "d78ae80b-34d5-4a1e-8845-48bbff14697b",
    "previous_page_cursor": null
  }
}

POSThttps://snapsbrew.com/api/v1/snaps

Create a Snap

This endpoint will allow you to make a POST request to create custom images or PDFs from templates that you've previously created inside SnapsBrew.

Required attributes

  • Name
    template_id
    Type
    string
    Description

    The ID of the template you want to use.

  • Name
    type
    Type
    string
    Description

    The type of snap you want to generate: image or pdf. Defaults to image

Optional attributes

  • Name
    variants
    Type
    array
    Description

    The variants field receives an array of Variant objects. This field will match and overwrite the layers of the template selected. If this field is not present in th request, an asset will be generated with the default template design.

cURL

POST
https://snapsbrew.com/api/v1/snaps
{
  "template_id": "141e8454-8aa1-420a-bd0b-18a85ba949a2",
  "type": "image",
  "variants": [
    {
      "layer": "review_poster",
      "image_url": "https://snapsbrew.com/crazy-doc-brown-jailed"
    },
    {
      "layer": "review_title",
      "text": "The worst Time-Travel movie ever made"
    },
    {
      "layer": "reviewer_handle",
      "text": "@grumpyTraveler"
    }
  ]
}

Response

{
  "id": "73824855-47b0-421d-be7d-e238ebfbfe29",
  "template_id": "141e8454-8aa1-420a-bd0b-18a85ba949a2",
  "type": "image",
  "variants": [
    {
      "layer": "review_poster",
      "image_url": "https://snapsbrew.com/crazy-doc-brown-jailed"
    },
    {
      "layer": "review_title",
      "text": "The worst Time-Travel movie ever made"
    },
    {
      "layer": "reviewer_handle",
      "text": "@grumpyTraveler"
    }
  ],
  "media_url": "https://snapsbrew.com/storage/43/conversions/media-librarywE0C8F-image.jpg",
  "created_at": "1985-10-15:18:38.000000Z"
}

GEThttps:://snapsbrew.com/api/v1/snaps/{id}

Retrieve a snap

This endpoint will allow you to make a GET request to get a single snap.

Response

{
  "id": "73824855-47b0-421d-be7d-e238ebfbfe29",
  "template_id": "141e8454-8aa1-420a-bd0b-18a85ba949a2",
  "type": "image",
  "variants": [
    {
      "layer": "review_poster",
      "image_url": "https://snapsbrew.com/crazy-doc-brown-jailed"
    },
    {
      "layer": "review_title",
      "text": "The worst Time-Travel movie ever made"
    },
    {
      "layer": "reviewer_handle",
      "text": "@grumpyTraveler"
    }
  ],
  "media_url": "https://snapsbrew.com/storage/43/conversions/media-librarywE0C8F-image.jpg",
  "created_at": "1985-10-15:18:38.000000Z"
}