Please follow these steps in order to launch the builder with valid pre-requisites. Endpoints were made in accordance with UI provided here, https://mailmailmail.dev.xenioo.com/ (steps for creating campaign)
Builder API on this host: Swagger UI (/documentation) — lists, templates, newsletters, launch token. Main App / CRUD (login, campaigns list): Authentication → Login user and Newsletters on the hosted Swagger.
All requests to this builder host (except login on the CRUD host) require Authorization: Bearer <access_token>. Use Builder API documentation to try builder endpoints below.
Open the Main App API docs and use Try it out where available.
POST https://staging-swagger-api.mailmailmaildev.net/api/v1/login
— body: username, password. The response includes access_token; use that value in the Authorization: Bearer header for the steps below.From the returned data, select at least one list (and optionally segments) for the campaign.
GET https://builder.marketingplatform.com/api/v1/listsGET https://builder.marketingplatform.com/api/v1/segmentsPick one of the following and get the ID (or use blank):
GET https://builder.marketingplatform.com/api/templates — select one templateId from the response.GET https://staging-swagger-api.mailmailmaildev.net/api/v1/newsletters
— select one newsletterid (campaign ID) from the response.GET https://builder.marketingplatform.com/api/newsletters/templates/default — use this when creating a blank campaign (no template/campaign ID).API documentation → Newsletters → Create newsletter
POST https://builder.marketingplatform.com/api/newslettersname, subject, lists, segments, and exactly one of: templateId, campaignId, or blankTemplate: true.newsletterid — use it in Step 4.POST https://builder.marketingplatform.com/api/builder/launchToken — body: { "newsletterid": <id from step 3> }. Response: token (and newsletterid).https://builder.marketingplatform.com/builder/launch?token=<token> (same URL for new tab or iframe). The launch page redirects to the builder with token and newsletterid in the URL so the campaign is set explicitly.If you embed the builder in an iframe and want Save and Save as template buttons in your own UI (outside the iframe), use the postMessage protocol so the parent app triggers save and receives the result. Enable those buttons only on the builder Builder tab (SAVE_STATE messages).