DEV.to API omits 'published' field from single-article endpoint, breaking publish checks
Developers scripting posts to DEV.to who rely on the single-article endpoint GET /api/articles/{id} to confirm a post is live will find the 'published' field is entirely absent from the response, not simply false or null. This means article.get('published') silently returns None, causing scripts to misidentify live articles as drafts and potentially trigger unwanted retries. The omission is consistent regardless of whether an API key is supplied, ruling out a permissions issue. The author-scoped endpoint GET /api/articles/me/published does return the 'published' field correctly, making it the right choice when distinguishing drafts from published posts. The most reliable publish confirmation is an unauthenticated GET request to the single-article endpoint — an HTTP 200 response confirms public visibility, while drafts and nonexistent articles both return 404.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in