Articles
Articles are objects representing a blog post. Each article belongs to a Blog.
Creating an Article
Section titled “Creating an Article”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" }});Getting an Article
Section titled “Getting an Article”var service = new ArticleService(myShopifyUrl, shopAccessToken);var article = await service.GetAsync(blogId, articleId);Updating an Article
Section titled “Updating an Article”var service = new ArticleService(myShopifyUrl, shopAccessToken);var article = await service.UpdateAsync(blogId, articleId, new Article(){ Title = "My new title"});Listing Articles
Section titled “Listing Articles”var service = new ArticleService(myShopifyUrl, shopAccessToken);var articles = await service.ListAsync(blogId);Counting Articles
Section titled “Counting Articles”var service = new ArticleService(myShopifyUrl, shopAccessToken);var count = await service.CountAsync(blogId);Deleting an Article
Section titled “Deleting an Article”var service = new ArticleService(myShopifyUrl, shopAccessToken);
await service.DeleteAsync(blogId, articleId);Listing all Article authors
Section titled “Listing all Article authors”var service = new ArticleService(myShopifyUrl, shopAccessToken);IEnumerable<string> authors = await service.ListAuthorsAsync();Listing all Article tags
Section titled “Listing all Article tags”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);