Cannot retrieve mobiledoc format via content API

I’m having trouble getting access to the mobiledoc format for posts and pages using the content-api.

If I send a get request, to posts or a single post by slug, I get the format shown without the mobile doc.

I can get both html and plaintext fine.

Am I trying to use the following formats field as described in the content API documentation.
Conent API Documentation

My site is is running ghost 2.18.1.

I get this problem using both the Javascript API Client and issuing posts in postman. I use “formats” as shown below.

const page = await ghostAPI().pages.read({
        slug,
        include: 'tags,authors',
        formats: 'mobiledoc'
      })

Please let me know if I’m doing something wrong or something is broken.

Thanks in advance!

See Content API V2: does not return mobiledoc · Issue #10097 · TryGhost/Ghost · GitHub

The Content API v2 does not return mobiledoc currently.

2 Likes

@Kate think our docs are a bit misleading in this case :sweat_smile: Will change it now.

@jacobgoodwin0 you would need to use Admin API in case you want to operate on mobiledoc

1 Like

Thanks for the reference to the github issue, tip, and updating the docs!

1 Like

@jacobgoodwin0 what is your use-case for needing the mobiledoc content?

@Kevin, I don’t have a critical use case. I’m generating a static site template with Nuxt and just saw the feature in the documentation and wanted to play around with it. So the HTML will work fine for this case.

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