Get linkifiers
GET https://devninja.zulipchat.com/api/v1/realm/linkifiers
List all of an organization's configured
linkifiers, regular
expression patterns that are automatically linkified when they appear
in messages and topics.
Changes: New in Zulip 4.0 (feature level 54). On older versions,
a similar GET /realm/filters endpoint was available with each entry in
a [pattern, url_format, id] tuple format.
Usage examples
#!/usr/bin/env python3
import zulip
# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/zuliprc")
# Fetch all the linkifiers in this organization.
result = client.call_endpoint(
url="/realm/linkifiers",
method="GET",
)
print(result)
The -u line implements HTTP Basic authentication.
See the Authorization header documentation for how
to get those credentials for Zulip users and bots.
curl -sSX GET -G https://devninja.zulipchat.com/api/v1/realm/linkifiers \
-u EMAIL_ADDRESS:API_KEY
Parameters
This endpoint does not accept any parameters.
Response
Return values
-
linkifiers: (object)[]
An ordered array of objects, where each object
describes a linkifier.
Clients should always process linkifiers in the order given;
this is important if the realm has linkifiers with overlapping
patterns. The order can be modified using PATCH
/realm/linkifiers.
-
pattern: string
The string regex pattern which represents the pattern that
should be linkified by this linkifier.
-
url_template: string
The RFC 6570 compliant
URL template to be used for linkifying matches.
Changes: New in Zulip 7.0 (feature level 176). This replaced url_format,
which contained a URL format string.
-
id: integer
The ID of the linkifier.
-
example_input: string | null
An example input string that matches the linkifier's pattern.
This is required for reverse linkifiers.
Changes: New in Zulip 12.0 (feature level 471).
-
reverse_template: string | null
A simple template using {variable} for variables that can
be used to generate the Markdown linkifier syntax, given a
URL matching the URL template.
{{/}} can be used for literal {/} characters.
Changes: New in Zulip 12.0 (feature level 471).
-
alternative_url_templates: (string)[]
An array of additional RFC 6570 compliant URL
template strings that are used for reverse linkification
(converting pasted URLs to linkifier pattern text). These
templates have no effect on forward linkification.
Changes: New in Zulip 12.0 (feature level e2b257).
Example response(s)
Changes: As of Zulip 7.0 (feature level 167), if any
parameters sent in the request are not supported by this
endpoint, a successful JSON response will include an
ignored_parameters_unsupported array.
A typical successful JSON response may look like:
{
"linkifiers": [
{
"alternative_url_templates": [
"https://github.com/zulip/zulip/pull/{id}"
],
"example_input": "#1234",
"id": 1,
"pattern": "#(?P<id>[0-9]+)",
"reverse_template": "#{id}",
"url_template": "https://github.com/zulip/zulip/issues/{id}"
}
],
"msg": "",
"result": "success"
}