Multiple mobiledoc cards

Using the Admin API what is the correct format to post multiple cards using mobiledoc?
The format below gives me an error Invalid mobiledoc structure.

                       let mobileDocJson = JSON.stringify({
                          version: '0.3.1',
                          markups: [],
                          atoms: [],
                          cards: [
                            ['html', { cardName: 'main', html: main_html }],
                            ['html', { cardName: 'list', html: list_html }]
                          ],
                          sections: [[10, 0]]
                      });

You can create a test post using the Koenig editor and use the API or monitor network requests to see what Ghost is storing :wink:

Do note that some cards are abstractions around sections (for example, dividers are <hr />)

Here’s a sample:

{
  "version":"0.3.1",
  "atoms":[],
  "cards":[
    ["html", {"html":"<strong>This is a bold block</strong>"}],
    ["html", {"html":"<ul>\n    <li>this is a ul.li block</li>\n</ul>"}]
  ],
  "markups":[],
  "sections":[[10,0],[10,1],[1,"p",[]]]
}

Thank You I was missing the ‘1’ in

[10,0],[10,1]

I had

[10,0],[10,0]

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.