Browse Source

add new target_domain param to /webmention API docs

pull/8/head
Ryan Barrett 8 years ago
parent
commit
14d7f00365
1 changed files with 18 additions and 1 deletions
  1. +18
    -1
      views/api.php

+ 18
- 1
views/api.php View File

@ -13,13 +13,15 @@ Post to `https://telegraph.p3k.io/webmention`
* `token` - your API key obtained after signing up * `token` - your API key obtained after signing up
* `source` - the URL of your post * `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 * `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 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. 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 #### Errors
* `authentication_required` - the token parameter was missing * `authentication_required` - the token parameter was missing
* `invalid_token` - the token was invalid or expired * `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"
]
}
```
<h2 class="ui dividing header">Status API</h2> <h2 class="ui dividing header">Status API</h2>
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: 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:

Loading…
Cancel
Save