Update a linkifier
PATCH https://drpc.zulipchat.com/api/v1/realm/filters/{filter_id}
Update a linkifier, regular
expression patterns that are automatically linkified when they appear
in messages and topics.
Changes: New in Zulip 4.0 (feature level 57).
Usage examples
#!/usr/bin/env python3
import zulip
# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/zuliprc")
# Update a linkifier.
request = {
"pattern": "#(?P<id>[0-9]+)",
"url_template": "https://github.com/zulip/zulip/issues/{id}",
"example_input": "#1234",
"reverse_template": "#{id}",
}
result = client.call_endpoint(
url=f"/realm/filters/{filter_id}", method="PATCH", request=request
)
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 PATCH https://drpc.zulipchat.com/api/v1/realm/filters/5 \
-u EMAIL_ADDRESS:API_KEY \
--data-urlencode 'pattern=#(?P<id>[0-9]+)' \
--data-urlencode 'url_template=https://github.com/zulip/zulip/issues/{id}' \
--data-urlencode 'example_input=#1234' \
--data-urlencode 'reverse_template=#{id}' \
--data-urlencode 'alternative_url_templates=["https://github.com/zulip/zulip/pull/{id}"]'
Parameters
filter_id integer required in path
Example: 5
The ID of the linkifier that you want to update.
pattern string required
Example: "#(?P<id>[0-9]+)"
url_template string required
Example: "https://github.com/zulip/zulip/issues/{id}"
The RFC 6570
compliant URL template used for the link.
If you used named groups in pattern, you can insert their
content here with {name_of_group}.
Changes: New in Zulip 7.0 (feature level 176). This replaced
the url_format_string parameter, which was a format string in which
named groups' content could be inserted with %(name_of_group)s.
reverse_template string | null optional
Example: "#{id}"
A simple template using {variable} for variables that can
be used to generate the Markdown linkifier syntax, given a
URL matching the URL template. Passing an empty string
will set this field back to null.
Server verifies that variables extracted from example_input using
url_pattern when passed to reverse_template returns example_input
back to us.
{{/}} can be used for literal {/} characters.
Changes: New in Zulip 12.0 (feature level 471).
alternative_url_templates (string)[] optional
Example: ["https://github.com/zulip/zulip/pull/{id}"]
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).
Response
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:
{
"msg": "",
"result": "success"
}