A space to discuss online store customization, theme development, and Liquid templating.
Is it possible to get the scheduled publication date of an article using the shopify API?
I read the API reference but couldn't find it.
I have verified the following:
https://shopify.dev/api/admin-rest/2022-07/resources/blog
https://shopify.dev/api/admin-rest/2022-07/resources/article
https://shopify.dev/api/admin-graphql/2022-07/objects/OnlineStoreArticle
https://shopify.dev/api/admin-graphql/2022-07/objects/OnlineStoreBlog
If anyone knows, please let me know.
Does this help
https://shopify.dev/api/admin-rest/2022-04/resources/article
look at the published_at field, try setting that for later date. Make sure when you do that to set the published to false.
Thank you for your reply.
I was able to confirm that the value of "published_at" becomes "nil" when setting the publication of the day.
response:
{
"id"=>561186144405,
"title"=>"テストブログ",
"created_at"=>"2022-11-14T15:16:39+09:00",
"body_html"=>"テストです。",
"author"=>"test",
"user_id"=>nil,
"published_at"=>nil,
"updated_at"=>"2023-01-12T12:00:59+09:00",
"summary_html"=>"",
"template_suffix"=>"",
"handle"=>"テストブログ",
"tags"=>"",
"admin_graphql_api_id"=>"gid://shopify/OnlineStoreArticle/561186144405"
}
But how can I get the scheduled release date that I set?
if you use the "Receive a single Article" the response has the "published_at" field.
https://shopify.dev/api/admin-rest/2022-04/resources/article#get-blogs-blog-id-articles-article-id
thank you.
I will refer to it.
I have the same problem, and this doesn't work for me. The published_at field always returns null if the blog post is scheduled in the future. I tried different API versions (2022-04, 2022-07, 2022-10, 2023-01). It makes no difference. There is no way to tell if a blog post is unpublished AND is scheduled to be published in the future.
Thank you very much.
I felt that way too.
Thank you very much for your clear answer.
Is this still not possible?
Hi @iewhrgoie,
I've looked into this behaviour further and after discussing with our developers I can confirm that it is expected behaviour that the `published_at` field will return `null` for any Blog Articles that are not yet published, this includes articles that has their "Visibility Date" scheduled to publish the article in the future.
At this time there is no current way to distinguish between a non-published article with or without a scheduled Visibility Date, and I do understand how this is a useful feature to have. I will be sending up feedback to our developer team to request that this feature is added to our API. We do take our partner and merchant's feedback into great value when determining what updates and changes happen on the platform, and while we can't guarantee this feature will be added, or when, we can guarantee that the feedback regarding this will be heard!
I hope this helps and I hope you have a great week 🙂
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Thank you for your reply.
Is this the same case with products? I have another post here, which I simply cannot work out: https://community.shopify.com/c/graphql-basics-and/how-do-i-schedule-a-publishing-date-through-graph...