Using the HTTP AtomPub API

Tcat Server reached its End of Life in 2017. Contact your Customer Success Manager to determine options for managing, monitoring, or deploying your application.

Tcat Server takes advantage of the simple but powerful Atom Publishing Protocol for much of its integration API. It is a RESTful HTTP-based API based on the concept of collections and entries. AtomPub collections can store anything. The Tcat Server API uses Atom entries to represent artifacts inside the Tcat Server registry (repository). Through the Atom Publishing Protocol, new items can be created, updated, and deleted.

Important Feed URLs

Tcat Server includes the following feeds:

Feed URL

Root Workspace List and Search


Workspace Listing



Child Workspaces



Artifact Versions






Artifacts as Atom Entries

Each feed listed above contains a series of Atom entries that represent artifacts inside the repository. An artifact might look like this:

  <link href="/api/registry/Default%20Workspace/hello.wsdl;atom" rel="edit" />
  <title type="text">hello.wsdl</title>
  <summary type="xhtml">This is a description of the WSDL</summary>

  <artifact-info xmlns=""
                 created="2008-10-31T21:16:16.272Z" name="hello.wsdl" />

  <version xmlns=""
           created="2008-10-31T21:16:16.272Z" />

  <metadata xmlns="" id="versioned">
    <property name="wsdl.binding.dependencies" locked="true" visible="true">
    <property name="wsdl.binding" locked="true" visible="true">
    <property name="wsdl.service" locked="true" visible="true">
    <property name="wsdl.targetNamespace" locked="true" visible="true" value="" />
    <lifecycle property="primary.lifecycle" name="Default" phase="Created">
      <previous-phases />
    <property name="wsdl.endpoint" locked="true" visible="true">
    <property name="wsdl.portType.dependencies" locked="true" visible="true">

  <metadata xmlns="" id="global" />

  <collection xmlns="" id="versions" href="/api/hello.wsdl;history">
    <atom:title xmlns:atom="" type="text">Artifact Versions</atom:title>

  <content type="application/xml" src="/api/registry/Default%20Workspace/hello.wsdl" />
  <link href="/api/registry/Default%20Workspace/hello.wsdl" rel="edit-media" />

Walking through this Atom entry, there are a few important things to note:

  • The <collection> element with the id="versions" attribute provides a link to the version history of the artifact.

  • To see the actual artifact, use the link provided in the <content> element.

  • The summary maps to the description field on the artifact.

  • The <metadata> sections represent metadata associated with this artifact.

    • The <metadata> with the global ID represents metadata associated with all versions of an artifact.

    • The <metadata> with the versioned ID represents metadata associated with this particular version.

    • Lifecycle properties are represented by the <lifecycle> element.

    • If the property is a multivalued property, there will be child <value> elements. If it is single valued, there will be a value attribute.

    • If the property has the locked attribute set to true, it has been created by an index and cannot be modified unless it is by the index.

Artifact History Feeds

An item’s history can be viewed by appending ;history to its URL. For example, if this is the artifact URL:


The history URL is:


The history URL returns a feed that contains Atom entries for each artifact version like those described in the previous section.

Using the Libraries

To use the AtomPub API with your Java application, we recommend using the Apache Abdera framework. Other tools like wget will work as well. For a more visual guidance, check out the lnk:[RestTest]FireFox plug-in.

For a more in-depth example using Abdera, see the AtomPub API Example.

Artifact Operations

The following table summarizes the operations that can be performed on the AtomPub API.

HTTP Verb URL Data Description




Gets all the artifacts in the repository




Gets an Atom feed of the artifacts and workspaces inside the workspace




Gets an Atom entry representation of the workspace




Gets an artifact



An artifact

Add a new artifact. See below for details.



A workspace Atom entry

Creates a new workspace. See below for details.



An artifact

Adds a new version of an artifact. See below for details.



An Atom representation of an artifact

Updates an artifact’s metadata in the registry



An artifact or workspace

Deletes an artifact or workspace

Browsing the Repository

This section describes how you can browse the repository through query parameters or URL encoding.

Querying the Repository

You can extend a URL with a query parameter to search the repository. Following are some example queries.

Selecting All XML Schema Artifacts


select artifact where documentType = {}schema



Selecting All JAR Artifacts


select artifact where contentType = 'application/java-archive'



URL Encoding

If you are using Abdera for your client code, the handy org.apache.abdera.i18n.text.UrlEncoding class has an encode method that can do this for you:

import org.apache.abdera.i18n.text.UrlEncoding;
import org.apache.abdera.i18n.text.CharUtils.Profile;

String encodedQuery = UrlEncoding.encode("select artifact where ...", Profile.PATH.filter());

Note: If you’re using Abdera 0.3.0, you must use the EncodingUtil.sanitize() method instead.

For a reference on which characters must be URL-encoded, see this page.

Replace any of these characters in your query with the appropriate encoded character. For instance, if you were encoding "select artifact", you would replace the space with %20, as that is the URL-encoded representation of the space character.

Adding an Artifact

When you add an artifact, you must supply additional HTTP headers that specify the workspace and artifact version:

  • The "X-Artifact-Version": the version label of the artifact you are POSTing.

  • The "Slug" header: used to determine the name of the artifact in the repository.

A typical HTTP POST looks like this:

POST /api/registry/WORKSPACE HTTP/1.0
Authorization: Basic YWRtaW46YWRtaW4=
Host: localhost:8080
Content-Type: text/plain
X-Artifact-Version: 1.0
Slug: test.txt

Here’s an example using wget:

$ wget --post-file=YOURFILE --http-user=admin --http-password=admin -S \
--header="X-Artifact-Version: 0.1" \
--header="Slug: ARTIFACT_NAME"

Adding a New Artifact Version

Adding a new artifact version is very similar to adding a new artifact, with the following exceptions:

  • Use the PUT verb

  • Use the URL of the artifact in the repository

  • Specify an X-Artifact-Version header

For example:

Authorization: Basic YWRtaW46YWRtaW4=
Host: localhost:8080
Content-Type: text/plain
X-Artifact-Version: 0.2

... data ...

Adding a Workspace

To add a workspace, post an Atom entry that represents the workspace to the parent workspace. For example:

POST /api/registry/Default%20Workspace;workspaces HTTP/1.0
Authorization: Basic YWRtaW46YWRtaW4=
Host: localhost:8080
Content-Type: application/atom+xml;type=entry

<entry xmlns="">
  <title type="text">MyNewWorkspace</title>
  <content type="text"></content>

This creates a new workspace called "MyNewWorkspace" in the parent workspace "Default Workspace".

To add a top-level workspace, POST to /api/registry. This workspace then is listed in /api/registry;workspaces.

Editing an Artifact’s Metadata

To edit an artifact’s metadata, PUT a new Atom entry representation to the artifact URL. You can update the artifact’s description, metadata, and lifecycle information.

For example, you could use this HTTP request to update the description of your artifact:

PUT /api/registry/Default%20Workspace/hello.wsdl;atom HTTP/1.0
Authorization: Basic YWRtaW46YWRtaW4=
Host: localhost:8080
Content-Type: application/atom+xml;type=entry

<entry xmlns="">
  <link href="/api/registry/Default%20Workspace/hello_world.wsdl;atom?version=0.2" rel="edit" />
  <title type="text">hello_world.wsdl Version 0.2</title>
  <summary type="xhtml">
    This  becomes your new artifact description.
  <content type="application/xml" src="/api/registry/Default%20Workspace/hello_world.wsdl?version=0.2" />
  <link href="/api/registry/Default%20Workspace/hello_world.wsdl?version=0.2" rel="edit-media" />

Note: You must PUT it to the Atom representation, which means you must append ;atom to the URL.

To edit an artifact’s metadata, you include a <metadata> element inside your Atom entry. Any <property> elements inside this element are modified. In the following example, the property favoriteSauce is added to the artifact with a value of ketchup.

<metadata id="versioned" xmlns="">
  <property name="favoriteSauce" value="ketchup"/>

Any metadata properties that are not present are NOT deleted. To delete a metadata property, remove all value attributes and child elements:

<metadata id="versioned" xmlns="">
  <property name="propertyToDelete" />

Next: AtomPub API Example >>

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub