From b8dd151043ed5e6f6fea1ccb958345b097bd9427 Mon Sep 17 00:00:00 2001 From: Arc <33088785+arcbtc@users.noreply.github.com> Date: Tue, 5 May 2020 20:07:54 +0100 Subject: [PATCH] Updated api docs to include listing specific LNURL --- .../templates/withdraw/_api_docs.html | 118 ++++++------------ 1 file changed, 35 insertions(+), 83 deletions(-) diff --git a/lnbits/extensions/withdraw/templates/withdraw/_api_docs.html b/lnbits/extensions/withdraw/templates/withdraw/_api_docs.html index bbc2d59..0f926b8 100644 --- a/lnbits/extensions/withdraw/templates/withdraw/_api_docs.html +++ b/lnbits/extensions/withdraw/templates/withdraw/_api_docs.html @@ -4,126 +4,78 @@ label="API info" :content-inset-level="0.5" > - + - GET /withdraw/api/v1/links + GET /withdraw/api/v1/links
Headers
{"X-Api-Key": <invoice_key>}
Body (application/json)
-
- Returns 201 CREATED (application/json) -
+
Returns 201 CREATED (application/json)
{"lnurl": <string>}
Curl example
- curl -X GET {{ request.url_root }}withdraw/api/v1/links -H - "X-Api-Key: <invoice_key>" - + curl -X GET {{ request.url_root }}withdraw/api/v1/links -H "X-Api-Key: {{ g.user.wallets[0].inkey }}"
- + - POST - /withdraw/api/v1/links + GET /withdraw/api/v1/links/<LNURL_id> +
Headers
+ {"X-Api-Key": <invoice_key>}
+
Body (application/json)
+
Returns 201 CREATED (application/json)
+ {"lnurl": <string>} +
Curl example
+ curl -X GET {{ request.url_root }}withdraw/api/v1/links/<LNURL_id> -H "X-Api-Key: {{ g.user.wallets[0].inkey }}" +
+
+
+ + + + POST /withdraw/api/v1/links
Headers
{"X-Api-Key": <admin_key>}
Body (application/json)
- {"title": <string>, "min_withdrawable": <integer>, - "max_withdrawable": <integer>, "uses": <integer>, - "wait_time": <integer>, "is_unique": <boolean>} -
- Returns 201 CREATED (application/json) -
+ {"title": <string>, "min_withdrawable": <integer>, "max_withdrawable": <integer>, "uses": <integer>, "wait_time": <integer>, "is_unique": <boolean>} +
Returns 201 CREATED (application/json)
{"lnurl": <string>}
Curl example
- curl -X POST {{ request.url_root }}withdraw/api/v1/links -d - '{"title": <string>, "min_withdrawable": <integer>, - "max_withdrawable": <integer>, "uses": <integer>, - "wait_time": <integer>, "is_unique": <boolean>}' -H - "Content-type: application/json" -H "X-Api-Key: <admin_key>" - + curl -X POST {{ request.url_root }}withdraw/api/v1/links -d '{"title": <string>, "min_withdrawable": <integer>, "max_withdrawable": <integer>, "uses": <integer>, "wait_time": <integer>, "is_unique": <boolean>}' -H "Content-type: application/json" -H "X-Api-Key: {{ g.user.wallets[0].adminkey }}" +
- + - PUT - /withdraw/api/v1/links/<withdraw_id> + PUT /withdraw/api/v1/links/<withdraw_id>
Headers
{"X-Api-Key": <admin_key>}
Body (application/json)
- {"title": <string>, "min_withdrawable": <integer>, - "max_withdrawable": <integer>, "uses": <integer>, - "wait_time": <integer>, "is_unique": <boolean>} -
- Returns 201 CREATED (application/json) -
+ {"title": <string>, "min_withdrawable": <integer>, "max_withdrawable": <integer>, "uses": <integer>, "wait_time": <integer>, "is_unique": <boolean>} +
Returns 201 CREATED (application/json)
{"lnurl": <string>}
Curl example
- curl -X PUT {{ request.url_root - }}withdraw/api/v1/links/<withdraw_id> -d '{"title": - <string>, "min_withdrawable": <integer>, - "max_withdrawable": <integer>, "uses": <integer>, - "wait_time": <integer>, "is_unique": <boolean>}' -H - "Content-type: application/json" -H "X-Api-Key: <admin_key>" - + curl -X PUT {{ request.url_root }}withdraw/api/v1/links/<withdraw_id> -d '{"title": <string>, "min_withdrawable": <integer>, "max_withdrawable": <integer>, "uses": <integer>, "wait_time": <integer>, "is_unique": <boolean>}' -H "Content-type: application/json" -H "X-Api-Key: {{ g.user.wallets[0].adminkey }}" +
- + - DELETE - /withdraw/api/v1/links/<withdraw_id> + DELETE /withdraw/api/v1/links/<withdraw_id>
Headers
{"X-Api-Key": <admin_key>}
Returns 201 NO_CONTENT
{"lnurl": <string>}
Curl example
- curl -X DELETE {{ request.url_root - }}withdraw/api/v1/links/<withdraw_id> -H "X-Api-Key: - <admin_key>" - + curl -X DELETE {{ request.url_root }}withdraw/api/v1/links/<withdraw_id> -H "X-Api-Key: {{ g.user.wallets[0].adminkey }}" + +