Shopify API – Article

top

Receive a list of all Articles

Get a list of all articles from a certain blog

Available URL Query parameters:

  • limit — Amount of results (default: 50) (maximum: 250)
  • page — Page to show (default: 1)
  • created_at_min — Show articles created after date (format: 2008-01-01 03:00)
  • created_at_max — Show articles created before date (format: 2008-01-01 03:00)
  • updated_at_min — Show articles last updated after date (format: 2008-01-01 03:00)
  • updated_at_max — Show articles last updated before date (format: 2008-01-01 03:00)
  • published_at_min — Show articles published after date (format: 2008-01-01 03:00)
  • published_at_max — Show articles published before date (format: 2008-01-01 03:00)
  • published_status
    • published - Show only published articles
    • unpublished - Show only unpublished articles
    • any - Show all articles (default)
GET /admin/blogs/#{id}/articles.xml

Get all the articles

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<articles type="array">
  <article>
    <author>John</author>
    <blog-id type="integer">1314995009</blog-id>
    <body>I have no idea what to write about, but it's going to rock!</body>
    <body-html>I have no idea what to write about, but it's going to rock!</body-html>
    <created-at type="datetime">2008-12-31T19:00:00-05:00</created-at>
    <id type="integer">2062775878</id>
    <published-at type="datetime" nil="true"></published-at>
    <title>Some crazy article I'm coming up with</title>
    <updated-at type="datetime">2009-01-31T19:00:00-05:00</updated-at>
  </article>
  <article>
    <author>Dennis</author>
    <blog-id type="integer">1314995009</blog-id>
    <body>Do _you_ have an *IPod* yet?</body>
    <body-html>&lt;p&gt;Do &lt;em&gt;you&lt;/em&gt; have an &lt;strong&gt;IPod&lt;/strong&gt; yet?&lt;/p&gt;</body-html>
    <created-at type="datetime">2008-07-31T20:00:00-04:00</created-at>
    <id type="integer">1208387130</id>
    <published-at type="datetime">2008-07-31T20:00:00-04:00</published-at>
    <title>get on the train now</title>
    <updated-at type="datetime">2008-07-31T20:00:00-04:00</updated-at>
  </article>
</articles>
top

Receive a count of all Articles

Get a count of all articles from a certain blog

Available URL Query parameters:

  • created_at_min — Count articles created after date (format: 2008-01-01 03:00)
  • created_at_max — Count articles created before date (format: 2008-01-01 03:00)
  • updated_at_min — Count articles last updated after date (format: 2008-01-01 03:00)
  • updated_at_max — Count articles last updated before date (format: 2008-01-01 03:00)
  • published_at_min — Count articles published after date (format: 2008-01-01 03:00)
  • published_at_max — Count articles published before date (format: 2008-01-01 03:00)
  • published_status
    • published - Count only published articles
    • unpublished - Count only unpublished articles
    • any - Count all articles (default)
GET /admin/blogs/#{id}/articles/count.xml

Count all a blog’s articles

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<count type="integer">2</count>
top

Receive a single Article

Get a single article by its ID and the ID of the parent blog

GET /admin/blogs/#{id}/articles/#{id}.xml

Get a single article

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<article>
  <author>Dennis</author>
  <blog-id type="integer">1314995009</blog-id>
  <body>Do _you_ have an *IPod* yet?</body>
  <body-html>&lt;p&gt;Do &lt;em&gt;you&lt;/em&gt; have an &lt;strong&gt;IPod&lt;/strong&gt; yet?&lt;/p&gt;</body-html>
  <created-at type="datetime">2008-07-31T20:00:00-04:00</created-at>
  <id type="integer">1208387130</id>
  <published-at type="datetime">2008-07-31T20:00:00-04:00</published-at>
  <title>get on the train now</title>
  <updated-at type="datetime">2008-07-31T20:00:00-04:00</updated-at>
</article>
top

Create a new Article

Create a new article for a blog

POST /admin/blogs/#{id}/articles.xml

Create a new article with textile markup and upload it to a blog.

Request

           
<?xml version="1.0" encoding="UTF-8"?>
<article>
  <title>My new Article title</title>
  <body>h1. I like articles

*Yea*, I like posting them through REST.</body>
</article>      

Response

           
HTTP/1.1 201 Created
<?xml version="1.0" encoding="UTF-8"?>
<article>
  <author> Shopify API</author>
  <blog-id type="integer">1314995009</blog-id>
  <body>h1. I like articles

*Yea*, I like posting them through REST.</body>
  <body-html>&lt;h1&gt;I like articles&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Yea&lt;/strong&gt;, I like posting them through &lt;span class=&quot;caps&quot;&gt;REST&lt;/span&gt;.&lt;/p&gt;</body-html>
  <created-at type="datetime">2009-10-20T07:25:00-04:00</created-at>
  <id type="integer">2062775883</id>
  <published-at type="datetime">2009-10-20T07:25:00-04:00</published-at>
  <title>My new Article title</title>
  <updated-at type="datetime">2009-10-20T07:25:00-04:00</updated-at>
</article>
top

Modify an existing Article

Update an article of a blog

PUT /admin/blogs/#{id}/articles/#{id}.xml

Update an exisiting article body

Request

           
<?xml version="1.0" encoding="UTF-8"?>
<article>
  <title>My new Title</title>
  <author>Your name</author>
  <body>Look, I can even update through a web service.</body>
  <id type="integer">1208387130</id>
</article>      

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<article>
  <author>Your name</author>
  <blog-id type="integer">1314995009</blog-id>
  <body>Look, I can even update through a web service.</body>
  <body-html>&lt;p&gt;Look, I can even update through a web service.&lt;/p&gt;</body-html>
  <created-at type="datetime">2008-07-31T20:00:00-04:00</created-at>
  <id type="integer">1208387130</id>
  <published-at type="datetime">2008-07-31T20:00:00-04:00</published-at>
  <title>My new Title</title>
  <updated-at type="datetime">2009-10-20T07:25:02-04:00</updated-at>
</article>
top

Modify an existing Article

Update all of a certain article data for a blog

PUT /admin/blogs/#{id}/articles/#{id}.xml

Update an exisiting article of a blog

Request

           
<?xml version="1.0" encoding="UTF-8"?>
<article>
  <title>My new Title</title>
  <author>Your name</author>
  <body>Look, I can even update through a web service.</body>
  <id type="integer">1208387130</id>
</article>      

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<article>
  <author>Your name</author>
  <blog-id type="integer">1314995009</blog-id>
  <body>Look, I can even update through a web service.</body>
  <body-html>&lt;p&gt;Look, I can even update through a web service.&lt;/p&gt;</body-html>
  <created-at type="datetime">2008-07-31T20:00:00-04:00</created-at>
  <id type="integer">1208387130</id>
  <published-at type="datetime">2008-07-31T20:00:00-04:00</published-at>
  <title>My new Title</title>
  <updated-at type="datetime">2009-10-20T07:25:03-04:00</updated-at>
</article>
top

Remove a Article from the database

Delete an article of a blog

DELETE /admin/blogs/#{id}/articles/#{id}.xml

Remove an exisiting article from a blog

Response

           
HTTP/1.1 200 OK
Last updated at Oct 2009 Oct:10 AM.