Hey @abhinav_panse ,
You can retrieve the preview URL of a blog/article in Shopify using the Admin API. However, directly getting the preview URL is not available via the API. Instead, you can construct the preview URL manually.
Retrieve the blog’s handle: You can get the handle of a blog using the Shopify Admin API. For instance, to get the handle of a blog, you can use the following endpoint:
GET /admin/api/2022-01/blogs/#{blog_id}.json
The response will include the handle of the article.
Create the preview URL: Once you have the blog’s handle, you can form the preview URL in the following structure:
[https://{shop}.myshopify.com/blogs/{blog_handle}?preview_key={preview_key}](https://{shop}.myshopify.com/blogs/{blog_handle}?preview_key={preview_key})
In this structure, {shop} is your shop name, {blog_handle} is the handle of your blog, and {preview_key} is the preview key for your shop.
The preview_key is not accessible via the API. It’s generated when you press the “Preview” button in the Shopify admin. You can locate it in the URL after you press the “Preview” button.
Please note that this method is only applicable for the store owner or staff with the appropriate permissions, as the preview key is necessary.