-
Notifications
You must be signed in to change notification settings - Fork 2
Endpoints
This page describes the endpoints provided by
django-wm
. See here for information on setting upurlpatterns
metadata for your views.
For django-wm
to work, you will need to include its URLs to your project's urlpatterns
. The path route is arbitrary, but webmention/
will be assumed throughout this documentation for simplicity.
# your_project/urls.py
urlpatterns = [
...
path("webmention/", include("mentions.urls")),
]
This will make the following endpoints accessible.
If someone wants to send you a webmention, this is where they will send it. To help them find it you should enable the provided middleware and add {% webmentions_endpoint %}
to your templates.
JSON API endpoint for retrieving webmentions for a page from your frontend.
Requires url
query parameter with the value of window.location.pathname
.
Sample JSON response
// /webmention/get?url=/my-article
{
"target_url": "https://my-site.org/my-article",
"mentions": [
{
"hcard": {
"name": "Jane Bloggs",
"avatar": "https://gravatar.com/janebloggs",
"homepage": "https://jane-bloggs-example.org"
},
"quote": null,
"source_url": "https://jane-bloggs-example.org/some-article",
"published": "2020-01-17T21:45:24.542Z",
"type": "webmention"
}
]
}
Provides a simple overview of the most recent webmention activity. By default this is only accessible to users with permission.