Skip to content

Instantly share code, notes, and snippets.

@mamund
Last active December 22, 2015 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mamund/6492803 to your computer and use it in GitHub Desktop.
Save mamund/6492803 to your computer and use it in GitHub Desktop.
ALPS description of http://webmention.org
*** REQUEST ***
GET /home HTTP/1.1
Accept: text/xml
*** RESPONSE ***
200 OK HTTP/1.1
Content-Type: text/xml
Link: <http://alps.io/profiles/webmention-alps.xml>; rel="profile"
.... <payload here> ....
<alps>
<!-- data elements -->
<descriptor id="source" type="semantic" />
<descriptor id="target" type="semantic" />
<descriptor id="results" type="semantic" />
<descriptor id="error_description" type="semantic" />
<descriptor id="error" type="semantic" />
<!-- transitions -->
<descriptor id="webmention" type="safe" />
<descriptor id="endpoint" type="unsafe">
<descriptor href="#source" />
<descriptor href="#target" />
</descriptor>
<descriptor id="success-response" type="semantic">
<descriptor href="#results" />
</descriptor>
<descriptor id="error-response" type="semantic">
<descriptor href="#error" />
<descriptor href="#error_description" />
</descriptor>
</alps>
<alps>
<descriptor id="webmention" type="safe" rel="http://webmention.org">
<doc format="asciidoc">
=== Webmention Link
The link that points to the resource on the server that accepts webmention POSTS
</doc>
</descriptor>
<descriptor id="source" type="semantic">
<doc format="asciidoc">
==== source
URL of resource generating the webmention.
</doc>
</descriptor>
<descriptor id="target" type="semantic">
<doc format="asciidoc">
==== target
URL of resource mentioned by the source.
</doc>
</descriptor>
<descriptor id="results" type="semantic">
<doc format="asciidoc">
==== results
Free-form text describing the success of the POST.
</doc>
</descriptor>
<descriptor id="error_description" type="semantic">
<doc format="asciidoc">
==== error_description
Free-form text describing the reason for the failure of the POST.
</doc>
</descriptor>
<descriptor id="error" type="semantic">
<doc format="asciidoc">
Valid error values are:
* source_not_found: The source URI does not exist.
* target_not_found: The target URI does not exist. This must only be used when an external GET on the target URI would result in an HTTP 404 response.
* target_not_supported: The specified target URI is not a WebMention-enabled resource. For example, on a blog, individual post pages may be WebMention-enabled but the home page may not.
* no_link_found: The source URI does not contain a link to the target URI.
* already_registered: The specified WebMention has already been registered.
</doc>
</descriptor>
<descriptor id="endpoint" type="unsafe">
<doc format="asciidoc">
=== Endpoint Form
The form that contains values to POST to the supplied URL.
The server MUST return 202 Accepted when a client successfully POSTs a body.
</doc>
<descriptor href="#source" />
<descriptor href="#target" />
</descriptor>
<descriptor id="success-response" type="semantic">
<doc format="asciidoc">
=== Success Response
Returned when a client POST succeeds
</doc>
<descriptor href="#results" />
</descriptor>
<descriptor id="error-response" type="semantic">
<doc format="asciidoc">
=== Error Response
Returned by a server when the client POST fails.
</doc>
<descriptor href="#error" />
<descriptor href="#error_description" />
</descriptor>
</alps>
<html>
<head>
<title>Caller's Blog Publisher</title>
<link rel="profile" href="http://alps.io/profiles/webmention" />
</head>
<body>
<form method="post" action="http://example.org/blog/publisher">
<input name="blogBody" type="text" value="..." />
<input name="permalink" type="text" value="..." class="source" />
<input type="submit" />
</form>
</body>
</html>
<html>
<head>
<link rel="webmention" href="http://example.org/mention" />
<link rel="profile" href="http://alps.io/profiles/webmention" />
</head>
<body>
<h1>Recent Posts</h1>
<ul>
<li><a href="..." class="target">Lamp Post</a></li>
<li><a href="..." class="target">Army Post</a></li>
<li><a href="..." class="target">Wooden Post</a></li>
<li><a href="..." class="target">Letter Post</a></li>
</ul>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment