Atom protocol (RFC-5023) is a REST-based protocol for creating, retrieving, updating and deleting collections of objects on a server. Objects are represented as Atom entries and collections as Atom feeds.
Service Document
To find out what workspaces and collections are available on an Atom server, send an authenticated HTTP GET request to the server's end-point URI.
![Service Document](/storage/rc-covers/6875-thumb.png)
You'll get back an Atom service document like the one below, which includes one workspace that contains two collections: one of entries and one of images. Note that each collection has a collection URI.
<?xml version="1.0" encoding='utf-8'?>
<service xmlns="http://www.w3.org/2007/app">
<workspace title="My blog" >
<collection title="Entries"
href="http://example.org/reilly/main" >
<accept>entry</accept>
</collection>
<collection title="Pictures"
href="http://example.org/reilly/pic" >
<accept>image/*</accept>
</collection>
</workspace>
</service>
Listing Collections
To retrieve the contents of a collection, send an authenticated HTTP GET request to the collection's URI.
![Send HTTP GET request](/storage/rc-covers/6876-thumb.png)
The server will respond by sending back an Atom feed containing the first portion of the collection and a next URI, which you can use to retrieve the next portion of the collection.
<feed xmlns="http://www.w3.org/2005/Atom">
<link rel="next"
href="http://example.org/entries/60" />
<link rel="previous"
href="http://example.org/entries/20" />
...
<entry> ... </entry>
<entry> ... </entry>
<entry> ... </entry>
<entry> ... </entry>
...
</feed>
Creating an Entry
To create a new entry within a collection, you simply post the XML for the entry to the collection's URI. For example, here's an example entry suitable for posting to an Atom server.
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
<id></id>
<title>Atom test post title</title>
<content>Atom test post content</content>
<updated>2006-05-16T00:00:00Z</updated>
</entry>
![Creating an Entry](/storage/rc-covers/6877-thumb.png)
The server will respond by creating an entry based on what you posted. It will fill in some blanks, such as the ID, and will return the Atom entry as it appears on the server. It will add in an edit URI, as shown below in bold, which you can use to retrieve, update or delete the entry.
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
<id>http://example.com/blog/entry/2223</id>
<link rel="alternate" type="text/html"
href="http://example.com/blog/entry/2223" />
<link rel="edit" type="text/html"
href="http://example.com/app/blog/entry/2223" />
<title>Atom test post title</title>
<content>Atom test post content</content>
<updated>2006-05-16T00:00:00Z</updated>
</entry>
Updating an Entry
To update an entry, you first send an authenticated HTTP GET request to the entry's edit URI to get the latest copy of the entry. You then edit the entry and use an authenticated HTTP PUT to the edit URI to update it on the server.
![Updating an Entry](/storage/rc-covers/6878-thumb.png)
{{ parent.title || parent.header.title}}
{{ parent.tldr }}
{{ parent.linkDescription }}
{{ parent.urlSource.name }}