Export ZIP

You can export a design in ZIP format using our REST Export API. This generates a bundle zip file that also includes all the images required by your design.

const fetch = require('node-fetch');

let url = 'https://api.unlayer.com/v2/export/zip';

let options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Basic BASE64-ENCODED-API-KEY'},
  body: JSON.stringify({
    displayMode: 'email',
    design: {}, // json of your design
    mergeTags: {first_name: 'John', last_name: 'Doe'}
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));

Learn more at Export API documentation.

Response

The API response will return an uploaded ZIP URL.

{
  "success": true,
  "data": {
    "url": "https://.../1593082715347-8LCcNZuuBpU4D92W.zip"
  }
}

Did this page help you?