Is mobiledoc removed from Ghost

Is Mobiledoc format removed from the Ghost?

Whenever I try calling the API endpoint, the mobiledoc is always null.

image

  • Ghost 5.69.0

Anyone from Ghost team? I know not Ghost is using Lexical editor. But the Developer Docs are not updated yet. There is no proper documentation of using APIs with this newly updated editor. Because calling the GET posts endpoint returns the mobiledoc null and no sign of post content in the API response.

This update broke the entire working of existing APIs and needs rebuilding.

@Hannah @DavidDarnes @Kevin

There should a lexical field that has the post content, @mcnaveen. At least there was a couple versions ago!

1 Like

Ah. Previously it was there. But in the most recent version it got removed afaik.

It’s definitely still there, because it’s the new way Ghost is storing data. I took a look at the way the admin panel is requesting post content, and it looks like this:

https://cathys-second-demo-site.ghost.io/ghost/api/admin/posts/652b0671370d650001bd5a54/?formats=mobiledoc%2Clexical&include=tags%2Cauthors%2Cauthors.roles%2Cemail%2Ctiers%2Cnewsletter%2Ccount.clicks%2Cpost_revisions%2Cpost_revisions.author
Request Method:
GET

Note especially that it’s passing the formats wanted: formats=mobiledoc%2Clexical
If you aren’t currently passing lexical as a wanted format, I’d try that.

Or if you’re using the SDK, looks like you need to pass the format:

api.posts.read( {id: '652b004f370d650001bd59d3', formats: ['lexical']})

(Browse works similarly.)

2 Likes

Thanks a lot @Cathy_Sarisky

1 Like

Note that explicitly requesting ?formats=mobiledoc will not cause mobiledoc to be included.