Question:
Getting a draft blog post’s rich content (richContent) doesn’t work.
Product:
Wix REST API / GetDraftPost endpoint
What are you trying to achieve:
I need to retrieve the rich content of a draft blog post so I can then modify it and update my website programmatically.
One of the rich content treatment processes will be to move the draft blog post’s content to a dedicated Wix Dynamic Page. Since a blog’s content is of the same type as a collection’s “rich content” column, it should be easy to export a draft blog post’s rich content and import it in a collection.
I’m creating an Educational Resources section on my website that will include educational guides using Dynamic Pages (1 guide = 1 dynamic page = 1 item in a GUIDE collection in the CMS). I don’t want these guides to be blog posts: I want more freedom in terms of layouts, navigation and table of contents. That will be achieved with custom layouts for the Guide template dynamic page.
I will also want to programmatically process each draft blog post’s so a manual solution is not an option.
What have you already tried:
I’ve used the “Try it out” button. I can connect with my account, site ID, provide a draft blog post ID, send the request, get an HTTP 200 response… I can check the fieldsets query param and set it to “URL” (without quote marks)… Fine.
BUT if I change the value of fieldsets to “richContent” or “RICHCONTENT”, I get an HTTP 400 Bad Request response.
Response Body
{
“message”: “Failed to parse JSON or deserialize protobuf message”,
“details”: {}
}
Additional information:
The documentation for the GetDraftPost endpoint only contains 1 example for the fieldset query parameter: URL. What if you want a different field than URL? Where’s the list of fields that can be accessed?