diff --git a/changedetectionio/api/Watch.py b/changedetectionio/api/Watch.py index 6a7031921..36c2b2f95 100644 --- a/changedetectionio/api/Watch.py +++ b/changedetectionio/api/Watch.py @@ -88,6 +88,8 @@ class Watch(Resource): # attr .last_changed will check for the last written text snapshot on change watch['last_changed'] = watch.last_changed watch['viewed'] = watch.viewed + watch['link'] = watch.link, + return watch @auth.check_token @@ -273,6 +275,8 @@ class CreateWatch(Resource): 'last_changed': watch.last_changed, 'last_checked': watch['last_checked'], 'last_error': watch['last_error'], + 'link': watch.link, + 'page_title': watch['page_title'], 'title': watch['title'], 'url': watch['url'], 'viewed': watch.viewed diff --git a/docs/api-spec.yaml b/docs/api-spec.yaml index 5669eb017..c47172511 100644 --- a/docs/api-spec.yaml +++ b/docs/api-spec.yaml @@ -129,7 +129,7 @@ components: maxLength: 5000 title: type: string - description: Custom title for the web page change monitor (watch) + description: Custom title for the web page change monitor (watch), not to be confused with page_title maxLength: 5000 tag: type: string @@ -255,6 +255,11 @@ components: type: integer description: Unix timestamp in seconds of the last time the watch was viewed. Setting it to a value higher than `last_changed` in the "Update watch" endpoint marks the watch as viewed. minimum: 0 + link: + type: string + format: string + description: The watch URL rendered in case of any Jinja2 markup, always use this for listing. + readOnly: true CreateWatch: allOf: @@ -395,8 +400,10 @@ paths: example: "095be615-a8ad-4c33-8e9c-c7612fbf6c9f": uuid: "095be615-a8ad-4c33-8e9c-c7612fbf6c9f" - url: "http://example.com" - title: "Example Website Monitor" + url: "http://example.com?id={{1+1}} - the raw URL" + link: "http://example.com?id=2 - the rendered URL, always use this for listing." + title: "Example Website Monitor - manually entered title/description" + page_title: "The HTML from the page" tags: ["550e8400-e29b-41d4-a716-446655440000"] paused: false muted: false @@ -406,8 +413,10 @@ paths: last_changed: 1640995200 "7c9e6b8d-f2a1-4e5c-9d3b-8a7f6e4c2d1a": uuid: "7c9e6b8d-f2a1-4e5c-9d3b-8a7f6e4c2d1a" - url: "https://news.example.org" - title: "News Site Tracker" + url: "http://example.com?id={{1+1}} - the raw URL" + link: "http://example.com?id=2 - the rendered URL, always use this for listing." + title: "News Site Tracker - manually entered title/description" + page_title: "The HTML <title> from the page" tags: ["330e8400-e29b-41d4-a716-446655440001"] paused: false muted: true