diff --git a/changedetectionio/api/api_v1.py b/changedetectionio/api/api_v1.py
index 90aa4b6b..aec65a36 100644
--- a/changedetectionio/api/api_v1.py
+++ b/changedetectionio/api/api_v1.py
@@ -33,7 +33,7 @@ class Watch(Resource):
@auth.check_token
def get(self, uuid):
"""
- @api {get} /api/v1/watch/:uuid Single watch information
+ @api {get} /api/v1/watch/:uuid Get a single watch data
@apiDescription Retrieve watch information and set muted/paused status
@apiExample {curl} Example usage:
curl http://localhost:4000/api/v1/watch/cc0cfffa-f449-477b-83ea-0caafd1dc091 -H"x-api-key:813031b16330fe25e3780cf0325daa45"
@@ -76,7 +76,7 @@ class Watch(Resource):
@auth.check_token
def delete(self, uuid):
"""
- @api {delete} /api/v1/watch/:uuid Delete watch information
+ @api {delete} /api/v1/watch/:uuid Delete a watch and related history
@apiExample {curl} Example usage:
curl http://localhost:4000/api/v1/watch/cc0cfffa-f449-477b-83ea-0caafd1dc091 -X DELETE -H"x-api-key:813031b16330fe25e3780cf0325daa45"
@apiParam {uuid} uuid Watch unique ID.
@@ -90,21 +90,18 @@ class Watch(Resource):
self.datastore.delete(uuid)
return 'OK', 204
- # Update an existing
@auth.check_token
@expects_json(schema_update_watch)
def put(self, uuid):
"""
@api {put} /api/v1/watch/:uuid Update watch information
@apiExample {curl} Example usage:
- Create a watch (POST)
- curl http://localhost:4000/api/v1/watch -H"x-api-key:813031b16330fe25e3780cf0325daa45" -H "Content-Type: application/json" -d '{"url": "https://my-nice.com" , "tag": "nice list"}'
Update (PUT)
curl http://localhost:4000/api/v1/watch/cc0cfffa-f449-477b-83ea-0caafd1dc091 -X PUT -H"x-api-key:813031b16330fe25e3780cf0325daa45" -H "Content-Type: application/json" -d '{"url": "https://my-nice.com" , "tag": "new list"}'
- @apiDescription Updates an existing watch using JSON, accepts the same structure as at https://github.com/dgtlmoon/changedetection.io/blob/fab7d325f764d6912bef671f1d78bf217689c537/changedetectionio/model/Watch.py#L15
+ @apiDescription Updates an existing watch using JSON, accepts the same structure as returned in get single watch information
@apiParam {uuid} uuid Watch unique ID.
- @apiName Update
+ @apiName Update a watch
@apiGroup Watch
@apiSuccess (200) {String} OK Was updated
@apiSuccess (500) {String} ERR Some other error
@@ -135,7 +132,7 @@ class WatchHistory(Resource):
@api {get} /api/v1/watch//history Get a list of all historical snapshots available for a watch
@apiDescription Requires `uuid`, returns list
@apiExample {curl} Example usage:
- curl http://localhost:4000/api/v1/watch/cc0cfffa-f449-477b-83ea-0caafd1dc091/history/1677092977 -H"x-api-key:813031b16330fe25e3780cf0325daa45" -H "Content-Type: application/json"
+ curl http://localhost:4000/api/v1/watch/cc0cfffa-f449-477b-83ea-0caafd1dc091/history -H"x-api-key:813031b16330fe25e3780cf0325daa45" -H "Content-Type: application/json"
@apiName Get list of available stored snapshots for watch
@apiGroup Watch History
@apiSuccess (200) {String} OK
@@ -156,7 +153,7 @@ class WatchSingleHistory(Resource):
def get(self, uuid, timestamp):
"""
@api {get} /api/v1/watch//history/ Get single snapshot from watch
- @apiDescription Requires `uuid` and `timestamp`, list of available snapshots can be found out XYZ, `timestamp` of `latest` to get the latest available.
+ @apiDescription Requires watch `uuid` and `timestamp`. `timestamp` of "`latest`" for latest available snapshot, or use the list returned here
@apiExample {curl} Example usage:
curl http://localhost:4000/api/v1/watch/cc0cfffa-f449-477b-83ea-0caafd1dc091/history/1677092977 -H"x-api-key:813031b16330fe25e3780cf0325daa45" -H "Content-Type: application/json"
@apiName Get single snapshot content
@@ -193,21 +190,19 @@ class CreateWatch(Resource):
@expects_json(schema_create_watch)
def post(self):
"""
- @api {post} /api/v1/watch Create a watch
- @apiDescription requires `url`, Creates a watch, also accepts accepts the same structure as at https://github.com/dgtlmoon/changedetection.io/blob/fab7d325f764d6912bef671f1d78bf217689c537/changedetectionio/model/Watch.py#L15
+ @api {post} /api/v1/watch Create a single watch
+ @apiDescription Requires atleast `url` set, can accept the same structure as get single watch information to create.
@apiExample {curl} Example usage:
curl http://localhost:4000/api/v1/watch -H"x-api-key:813031b16330fe25e3780cf0325daa45" -H "Content-Type: application/json" -d '{"url": "https://my-nice.com" , "tag": "nice list"}'
@apiName Create
- @apiGroup Watch Management
+ @apiGroup Watch
@apiSuccess (200) {String} OK Was created
@apiSuccess (500) {String} ERR Some other error
"""
- #
json_data = request.get_json()
url = json_data['url'].strip()
-
if not validators.url(json_data['url'].strip()):
return "Invalid or unsupported URL", 400
diff --git a/docs/api_v1/assets/main.bundle.js b/docs/api_v1/assets/main.bundle.js
index 1ccc446d..347098f0 100644
--- a/docs/api_v1/assets/main.bundle.js
+++ b/docs/api_v1/assets/main.bundle.js
@@ -1,5 +1,5 @@
-(()=>{var Za={9737:()=>{+function(x){"use strict";var E=".dropdown-backdrop",o='[data-toggle="dropdown"]',d=function(l){x(l).on("click.bs.dropdown",this.toggle)};d.VERSION="3.4.1";function r(l){var s=l.attr("data-target");s||(s=l.attr("href"),s=s&&/#[A-Za-z]/.test(s)&&s.replace(/.*(?=#[^\s]*$)/,""));var f=s!=="#"?x(document).find(s):null;return f&&f.length?f:l.parent()}function n(l){l&&l.which===3||(x(E).remove(),x(o).each(function(){var s=x(this),f=r(s),g={relatedTarget:this};!f.hasClass("open")||l&&l.type=="click"&&/input|textarea/i.test(l.target.tagName)&&x.contains(f[0],l.target)||(f.trigger(l=x.Event("hide.bs.dropdown",g)),!l.isDefaultPrevented()&&(s.attr("aria-expanded","false"),f.removeClass("open").trigger(x.Event("hidden.bs.dropdown",g))))}))}d.prototype.toggle=function(l){var s=x(this);if(!s.is(".disabled, :disabled")){var f=r(s),g=f.hasClass("open");if(n(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&x(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(x(this)).on("click",n);var i={relatedTarget:this};if(f.trigger(l=x.Event("show.bs.dropdown",i)),l.isDefaultPrevented())return;s.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(x.Event("shown.bs.dropdown",i))}return!1}},d.prototype.keydown=function(l){if(!(!/(38|40|27|32)/.test(l.which)||/input|textarea/i.test(l.target.tagName))){var s=x(this);if(l.preventDefault(),l.stopPropagation(),!s.is(".disabled, :disabled")){var f=r(s),g=f.hasClass("open");if(!g&&l.which!=27||g&&l.which==27)return l.which==27&&f.find(o).trigger("focus"),s.trigger("click");var i=" li:not(.disabled):visible a",v=f.find(".dropdown-menu"+i);if(!!v.length){var h=v.index(l.target);l.which==38&&h>0&&h--,l.which==40&&h{+function(x){"use strict";var E=function(r,n){this.init("popover",r,n)};if(!x.fn.tooltip)throw new Error("Popover requires tooltip.js");E.VERSION="3.4.1",E.DEFAULTS=x.extend({},x.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'