Post by api failure


#1

POST JSON:

{
	"posts": [
		{
            "title": "Hello, world",
            "slug": "Hello, world",
            "markdown": "Hello, world",
            "status": "published"
          }
	]
}

RETURN JSON:

{
    "posts": [
        {
            "id": "5b9dde5c701233235cbf1196",
            "uuid": "3df6db74-2cca-4627-bdb5-07931ab356d0",
            "title": "Hello, world",
            "slug": "hello-world-2",
            "html": "<p></p>",
            "comment_id": "5b9dde5c701233235cbf1196",
            "feature_image": null,
            "featured": false,
            "page": false,
            "status": "published",
            "locale": null,
            "visibility": "public",
            "meta_title": null,
            "meta_description": null,
            "created_at": "2018-09-16T04:38:52.000Z",
            "created_by": "1",
            "updated_at": "2018-09-16T04:38:52.000Z",
            "updated_by": "1",
            "published_at": "2018-09-16T04:38:52.000Z",
            "published_by": "1",
            "custom_excerpt": null,
            "codeinjection_head": null,
            "codeinjection_foot": null,
            "og_image": null,
            "og_title": null,
            "og_description": null,
            "twitter_image": null,
            "twitter_title": null,
            "twitter_description": null,
            "custom_template": null,
            "author": "1",
            "primary_author": null,
            "url": "/hello-world-2/",
            "primary_tag": null
        }
    ]
}

html field is always <p></p>

Could you tell me why?

Thanks!


#2

The current v0.1API requires a mobiledoc field from which to generate the html and plaintext content from. You’re using a private API that is not documented or designed for external use so there’s not much information available for what you’re trying to do.

If you can wait I would suggest waiting for the new v2 API and authentication mechanisms to land:

If you can’t wait then you should examine the network requests made by the admin area (it’s an SPA that uses the private API) to determine the required fields and formats.


#3

OK, Thanks!


#4

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