Skip to content

Articles

Articles are objects representing a blog post. Each article belongs to a Blog.

var service = new ArticleService(myShopifyUrl, shopAccessToken);
var article = await service.CreateAsync(blogId, new Article()
{
Title = "My new Article title",
Author = "John Smith",
Tags = "This Post, Has Been Tagged",
BodyHtml = "<h1>Hello world!</h1>",
Image = new ArticleImage()
{
Attachment = "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n"
}
});
var service = new ArticleService(myShopifyUrl, shopAccessToken);
var article = await service.GetAsync(blogId, articleId);
var service = new ArticleService(myShopifyUrl, shopAccessToken);
var article = await service.UpdateAsync(blogId, articleId, new Article()
{
Title = "My new title"
});
var service = new ArticleService(myShopifyUrl, shopAccessToken);
var articles = await service.ListAsync(blogId);
var service = new ArticleService(myShopifyUrl, shopAccessToken);
var count = await service.CountAsync(blogId);
var service = new ArticleService(myShopifyUrl, shopAccessToken);
await service.DeleteAsync(blogId, articleId);
var service = new ArticleService(myShopifyUrl, shopAccessToken);
IEnumerable<string> authors = await service.ListAuthorsAsync();
var service = new ArticleService(myShopifyUrl, shopAccessToken);
IEnumerable<string> tags = await service.ListTagsAsync();

Listing all Article tags for a single Blog

Section titled “Listing all Article tags for a single Blog”
var service = new ArticleService(myShopifyUrl, shopAccessToken);
IEnumerable<string> tags = await service.ListTagsForBlogAsync(blogId);