From 14d7f0036506dd5d5b24b1c030d39879f39d7e52 Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Wed, 3 Feb 2016 09:49:25 -0800 Subject: [PATCH] add new target_domain param to /webmention API docs --- views/api.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/views/api.php b/views/api.php index 6967989..093d40f 100644 --- a/views/api.php +++ b/views/api.php @@ -13,13 +13,15 @@ Post to `https://telegraph.p3k.io/webmention` * `token` - your API key obtained after signing up * `source` - the URL of your post -* `target` - the URL you linked to +* `target` OR `target_domain` - the URL or domain you linked to, respectively * `callback` - (optional) - a URL that will receive a web hook when new information about this webmention is available The Telegraph API will validate the parameters and then queue the webmention for sending. If there was a problem with the request, you will get an error response immediately. The API will first make an HTTP request to the source URL, and look for a link to the target on the page. This happens synchronously so you will get this error reply immediately. +If you pass `target_domain` instead of `target`, Telegraph will find and enqueue webmentions for all links to that domain. + #### Errors * `authentication_required` - the token parameter was missing * `invalid_token` - the token was invalid or expired @@ -55,6 +57,21 @@ Location: https://telegraph.p3k.io/webmention/xxxxxxxx } ``` +If you use `target_domain` instead of `target`, the `location` field will be a list containing the status URLs for each webmention that was queued. The `Location` header will be omitted. + +``` +HTTP/1.1 201 Created +Content-type: application/json + +{ + "status": "queued", + "location": [ + "https://telegraph.p3k.io/webmention/xxxxxxxx", + "https://telegraph.p3k.io/webmention/yyyyyyyy" + ] +} +``` +

Status API

You can poll the status URL returned after queuing a webmention for more information on the progress of sending the webmention. The response will look like the following: