Hey everyone - I cannot find the newsletter ID in my Ghost Dashboard. We would like to subscribe the registered users of our webapp to the blog as subscribers.
The admin API has a property for the ID of the newsletter. Where can I find it?
Hey everyone - I cannot find the newsletter ID in my Ghost Dashboard. We would like to subscribe the registered users of our webapp to the blog as subscribers.
The admin API has a property for the ID of the newsletter. Where can I find it?
Hi! The dashboard doesn’t show this in the UI, but there are a few methods to get what you need.
The same API you’re posting to also has an endpoint for retrieving newsletter data.
# GET
admin/newsletters/?limit=all
If you’re using the Admin client, you can get this there too.
# example code
# `api` is the admin client
const response = await api.newsletters.browse();
console.log(response); // => JSON object
In the dashboard, head to example.com/ghost/#/settings/newsletters
, open the dev tools, and in the Network tab, look for a request to /ghost/api/admin/newsletters/?include=count.members%2Ccount.posts&limit=all
.
All 3 show the same JSON with the id
parameter you need.