test2
In addition to an online storefront, Shopify shops come with a built-in blogging engine, allowing a shop to have one or more blogs.
Shop owners are encouraged to use blogs to:
- Make announcements
- Talk about their products in more detail
- Show off their expertise
- Connect with their customers and
- Boost their shop's search engine rankings
Shopify blogs are like most other blogs: a content management system for articles posted in reverse chronological order. Articles can be posted under one or more user-defined categories and tagged with one or more user-defined tags, with an option to allow readers to post comments to articles. An Atom feed is automatically generated for each blog, allowing for syndication. The search functionality built into every shop also searches the text in blog articles.
Blogs are meant to be used as a type of magazine or newsletter for the shop, with content that changes over time. If your shop needs a static page (such as an "About Us" page), we recommend that you use a Page instead.
Also see the Article resource for managing blog articles.
-
post/admin
/api /2021-10 /blogs.json Create a new Blog - get/admin
/api /2021-10 /blogs.json Retrieve a list of all blogs - get/admin
/api /2021-10 /blogs /{blog_id}.json Receive a single Blog - get/admin
/api /2021-10 /blogs /count.json Receive a count of all Blogs - put/admin
/api /2021-10 /blogs /{blog_id}.json Modify an existing Blog - del/admin
/api /2021-10 /blogs /{blog_id}.json Remove an existing Blog
Indicates whether readers can post comments to the blog and if comments are moderated or not. Possible values are:
- no (default): Readers cannot post comments to blog articles.
- moderate: Readers can post comments to blog articles, but comments must be moderated before they appear.
- yes: Readers can post comments to blog articles without moderation.
Attaches additional metadata to a store's resources:
- key (required): Identifier for the metafield (maximum of 30 characters).
- namespace (required): Container for a set of metadata. Namespaces help distinguish between metadata you created and metadata created by another individual with a similar namespace (maximum of 20 characters).
- value (required): Information to be stored as metadata.
- value_type (required): States whether the information in the value is stored as a 'string' or 'integer.'
- description (optional): Additional information about the metafield.
1
{
2 "commentable": "no",
3 "created_at": "2012-03-13T16:09:54-04:00",
4 "feedburner": null,
5 "feedburner_location": null,
6 "handle": "apple-blog",
7 "id": 241253187,
8 "metafield": {
9 "key": "new",
10 "value": "newvalue",
11 "namespace": "global",
12 "value_type": "string"
13 },
14 "tags": "tagged",
15 "template_suffix": null,
16 "title": "My Blog",
17 "updated_at": "2006-02-01T19:00:00-05:00"
18}
- curl
- Node.js
- PHP
curl -d '{"blog":{"title":"Apple main blog"}}' \-X POST "https://your-development-store.myshopify.com/admin/api/2021-10/blogs.json" \-H "X-Shopify-Access-Token: {access_token}"
1HTTP/1.1 201 Created2{3 "blog": {4 "id": 1008414251,5 "handle": "apple-main-blog",6 "title": "Apple main blog",7 "updated_at": "2021-10-01T16:45:34-04:00",8 "commentable": "no",9 "feedburner": null,10 "feedburner_location": null,11 "created_at": "2021-10-01T16:45:34-04:00",12 "template_suffix": null,13 "tags": "",14 "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414251"15 }16}
- curl
- Node.js
- PHP
curl -d '{"blog":{"title":"Apple main blog"}}' \-X POST "https://your-development-store.myshopify.com/admin/api/2021-10/blogs.json" \-H "X-Shopify-Access-Token: {access_token}"
1HTTP/1.1 201 Created2{3 "blog": {4 "id": 1008414251,5 "handle": "apple-main-blog",6 "title": "Apple main blog",7 "updated_at": "2021-10-01T16:45:34-04:00",8 "commentable": "no",9 "feedburner": null,10 "feedburner_location": null,11 "created_at": "2021-10-01T16:45:34-04:00",12 "template_suffix": null,13 "tags": "",14 "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414251"15 }16}
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.- curl
- Node.js
- PHP
curl -X GET "https://your-development-store.myshopify.com/admin/api/2021-10/blogs.json" \-H "X-Shopify-Access-Token: {access_token}"
1HTTP/1.1 200 OK
2{
3 "blogs": [
4 {
5 "id": 382285388,
6 "handle": "banana-blog",7 "title": "A Gnu Blog",8 "updated_at": "2006-02-02T19:00:00-05:00",9 "commentable": "no",10 "feedburner": null,11 "feedburner_location": null,12 "created_at": "2021-10-01T16:42:46-04:00",13 "template_suffix": null,14 "tags": "",15 "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"16 },17 {18 "id": 241253187,19 "handle": "apple-blog",20 "title": "Mah Blog",21 "updated_at": "2006-02-01T19:00:00-05:00",22 "commentable": "no",23 "feedburner": null,24 "feedburner_location": null,25 "created_at": "2021-10-01T16:42:46-04:00",26 "template_suffix": null,
27 "tags": "Announcing, Mystery",
28 "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"
29 }
30 ]
31}
- curl
- Node.js
- PHP
curl -X GET "https://your-development-store.myshopify.com/admin/api/2021-10/blogs.json" \-H "X-Shopify-Access-Token: {access_token}"
1HTTP/1.1 200 OK2{3 "blogs": [4 {5 "id": 382285388,6 "handle": "banana-blog",7 "title": "A Gnu Blog",8 "updated_at": "2006-02-02T19:00:00-05:00",9 "commentable": "no",10 "feedburner": null,11 "feedburner_location": null,12 "created_at": "2021-10-01T16:42:46-04:00",13 "template_suffix": null,14 "tags": "",15 "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"16 },17 {18 "id": 241253187,19 "handle": "apple-blog",20 "title": "Mah Blog",21 "updated_at": "2006-02-01T19:00:00-05:00",22 "commentable": "no",23 "feedburner": null,24 "feedburner_location": null,25 "created_at": "2021-10-01T16:42:46-04:00",26 "template_suffix": null,27 "tags": "Announcing, Mystery",28 "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"29 }30 ]31}
- curl
- Node.js
- PHP
curl -X GET "https://your-development-store.myshopify.com/admin/api/2021-10/blogs/241253187.json" \-H "X-Shopify-Access-Token: {access_token}"
1HTTP/1.1 200 OK2{3 "blog": {4 "id": 241253187,5 "handle": "apple-blog",6 "title": "Mah Blog",7 "updated_at": "2006-02-01T19:00:00-05:00",8 "commentable": "no",9 "feedburner": null,10 "feedburner_location": null,11 "created_at": "2021-10-01T16:42:46-04:00",12 "template_suffix": null,13 "tags": "Announcing, Mystery",14 "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"15 }16}
- curl
- Node.js
- PHP
curl -X GET "https://your-development-store.myshopify.com/admin/api/2021-10/blogs/241253187.json" \-H "X-Shopify-Access-Token: {access_token}"
1HTTP/1.1 200 OK2{3 "blog": {4 "id": 241253187,5 "handle": "apple-blog",6 "title": "Mah Blog",7 "updated_at": "2006-02-01T19:00:00-05:00",8 "commentable": "no",9 "feedburner": null,10 "feedburner_location": null,11 "created_at": "2021-10-01T16:42:46-04:00",12 "template_suffix": null,13 "tags": "Announcing, Mystery",14 "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"15 }16}
- curl
- Node.js
- PHP
curl -X GET "https://your-development-store.myshopify.com/admin/api/2021-10/blogs/count.json" \-H "X-Shopify-Access-Token: {access_token}"
1HTTP/1.1 200 OK2{3 "count": 24}
- curl
- Node.js
- PHP
curl -d '{"blog":{"id":241253187,"title":"IPod Updates"}}' \-X PUT "https://your-development-store.myshopify.com/admin/api/2021-10/blogs/241253187.json" \-H "X-Shopify-Access-Token: {access_token}"
1HTTP/1.1 200 OK2{3 "blog": {4 "title": "IPod Updates",5 "handle": "apple-blog",6 "id": 241253187,7 "updated_at": "2021-10-01T16:45:37-04:00",8 "commentable": "no",9 "feedburner": null,10 "feedburner_location": null,11 "created_at": "2021-10-01T16:42:46-04:00",12 "template_suffix": null,13 "tags": "Announcing, Mystery",14 "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"15 }16}
- curl
- Node.js
- PHP
curl -d '{"blog":{"id":241253187,"title":"IPod Updates"}}' \-X PUT "https://your-development-store.myshopify.com/admin/api/2021-10/blogs/241253187.json" \-H "X-Shopify-Access-Token: {access_token}"
1HTTP/1.1 200 OK2{3 "blog": {4 "title": "IPod Updates",5 "handle": "apple-blog",6 "id": 241253187,7 "updated_at": "2021-10-01T16:45:37-04:00",8 "commentable": "no",9 "feedburner": null,10 "feedburner_location": null,11 "created_at": "2021-10-01T16:42:46-04:00",12 "template_suffix": null,13 "tags": "Announcing, Mystery",14 "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"15 }16}
- curl
- Node.js
- PHP
curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2021-10/blogs/241253187.json" \-H "X-Shopify-Access-Token: {access_token}"
1HTTP/1.1 200 OK2{}