Hi, im trying to use the ghost API to add a post on the website…
const GHOST_API = new GhostAdminAPI({
url: END_POINT,
version: "v3",
key: GHOST_KEY
});
GHOST_API.posts.add({
title: 'My first draft API post',
mobiledoc: '{\"version\":\"0.3.1\",\"atoms\":[],\"cards\":[],\"markups\":[],\"sections\":[[1,\"p\",[[0,[],0,\"My post content. Work in progress...\"]]]]}'
}).then(result => {
res.send(JSON.stringify(result) + " - SUCCESS!")
}).catch(err => {
res.send(JSON.stringify(err) + " - ERROR!")
});
The result
being the Array of posts i already have, but it does not add the new one.
Ive used this guide: https://ghost.org/docs/api/v3/javascript/admin/