148 lines
5.2 KiB
HTML
148 lines
5.2 KiB
HTML
<q-expansion-item
|
|
group="extras"
|
|
icon="swap_vertical_circle"
|
|
label="API info"
|
|
:content-inset-level="0.5"
|
|
>
|
|
<q-expansion-item group="api" dense expand-separator label="List captchas">
|
|
<q-card>
|
|
<q-card-section>
|
|
<code><span class="text-blue">GET</span> /captcha/api/v1/captchas</code>
|
|
<h5 class="text-caption q-mt-sm q-mb-none">Headers</h5>
|
|
<code>{"X-Api-Key": <invoice_key>}</code><br />
|
|
<h5 class="text-caption q-mt-sm q-mb-none">Body (application/json)</h5>
|
|
<h5 class="text-caption q-mt-sm q-mb-none">
|
|
Returns 200 OK (application/json)
|
|
</h5>
|
|
<code>[<captcha_object>, ...]</code>
|
|
<h5 class="text-caption q-mt-sm q-mb-none">Curl example</h5>
|
|
<code
|
|
>curl -X GET {{ request.url_root }}captcha/api/v1/captchas -H
|
|
"X-Api-Key: {{ g.user.wallets[0].inkey }}"
|
|
</code>
|
|
</q-card-section>
|
|
</q-card>
|
|
</q-expansion-item>
|
|
<q-expansion-item group="api" dense expand-separator label="Create a captcha">
|
|
<q-card>
|
|
<q-card-section>
|
|
<code
|
|
><span class="text-green">POST</span> /captcha/api/v1/captchas</code
|
|
>
|
|
<h5 class="text-caption q-mt-sm q-mb-none">Headers</h5>
|
|
<code>{"X-Api-Key": <admin_key>}</code><br />
|
|
<h5 class="text-caption q-mt-sm q-mb-none">Body (application/json)</h5>
|
|
<code
|
|
>{"amount": <integer>, "description": <string>, "memo":
|
|
<string>, "remembers": <boolean>, "url":
|
|
<string>}</code
|
|
>
|
|
<h5 class="text-caption q-mt-sm q-mb-none">
|
|
Returns 201 CREATED (application/json)
|
|
</h5>
|
|
<code
|
|
>{"amount": <integer>, "description": <string>, "id":
|
|
<string>, "memo": <string>, "remembers": <boolean>,
|
|
"time": <int>, "url": <string>, "wallet":
|
|
<string>}</code
|
|
>
|
|
<h5 class="text-caption q-mt-sm q-mb-none">Curl example</h5>
|
|
<code
|
|
>curl -X POST {{ request.url_root }}captcha/api/v1/captchas -d
|
|
'{"url": <string>, "memo": <string>, "description":
|
|
<string>, "amount": <integer>, "remembers":
|
|
<boolean>}' -H "Content-type: application/json" -H "X-Api-Key:
|
|
{{ g.user.wallets[0].adminkey }}"
|
|
</code>
|
|
</q-card-section>
|
|
</q-card>
|
|
</q-expansion-item>
|
|
<q-expansion-item
|
|
group="api"
|
|
dense
|
|
expand-separator
|
|
label="Create an invoice (public)"
|
|
>
|
|
<q-card>
|
|
<q-card-section>
|
|
<code
|
|
><span class="text-green">POST</span>
|
|
/captcha/api/v1/captchas/<captcha_id>/invoice</code
|
|
>
|
|
<h5 class="text-caption q-mt-sm q-mb-none">Body (application/json)</h5>
|
|
<code>{"amount": <integer>}</code>
|
|
<h5 class="text-caption q-mt-sm q-mb-none">
|
|
Returns 201 CREATED (application/json)
|
|
</h5>
|
|
<code
|
|
>{"payment_hash": <string>, "payment_request":
|
|
<string>}</code
|
|
>
|
|
<h5 class="text-caption q-mt-sm q-mb-none">Curl example</h5>
|
|
<code
|
|
>curl -X POST {{ request.url_root
|
|
}}captcha/api/v1/captchas/<captcha_id>/invoice -d '{"amount":
|
|
<integer>}' -H "Content-type: application/json"
|
|
</code>
|
|
</q-card-section>
|
|
</q-card>
|
|
</q-expansion-item>
|
|
<q-expansion-item
|
|
group="api"
|
|
dense
|
|
expand-separator
|
|
label="Check invoice status (public)"
|
|
>
|
|
<q-card>
|
|
<q-card-section>
|
|
<code
|
|
><span class="text-green">POST</span>
|
|
/captcha/api/v1/captchas/<captcha_id>/check_invoice</code
|
|
>
|
|
<h5 class="text-caption q-mt-sm q-mb-none">Body (application/json)</h5>
|
|
<code>{"payment_hash": <string>}</code>
|
|
<h5 class="text-caption q-mt-sm q-mb-none">
|
|
Returns 200 OK (application/json)
|
|
</h5>
|
|
<code>{"paid": false}</code><br />
|
|
<code
|
|
>{"paid": true, "url": <string>, "remembers":
|
|
<boolean>}</code
|
|
>
|
|
<h5 class="text-caption q-mt-sm q-mb-none">Curl example</h5>
|
|
<code
|
|
>curl -X POST {{ request.url_root
|
|
}}captcha/api/v1/captchas/<captcha_id>/check_invoice -d
|
|
'{"payment_hash": <string>}' -H "Content-type: application/json"
|
|
</code>
|
|
</q-card-section>
|
|
</q-card>
|
|
</q-expansion-item>
|
|
<q-expansion-item
|
|
group="api"
|
|
dense
|
|
expand-separator
|
|
label="Delete a captcha"
|
|
class="q-pb-md"
|
|
>
|
|
<q-card>
|
|
<q-card-section>
|
|
<code
|
|
><span class="text-pink">DELETE</span>
|
|
/captcha/api/v1/captchas/<captcha_id></code
|
|
>
|
|
<h5 class="text-caption q-mt-sm q-mb-none">Headers</h5>
|
|
<code>{"X-Api-Key": <admin_key>}</code><br />
|
|
<h5 class="text-caption q-mt-sm q-mb-none">Returns 204 NO CONTENT</h5>
|
|
<code></code>
|
|
<h5 class="text-caption q-mt-sm q-mb-none">Curl example</h5>
|
|
<code
|
|
>curl -X DELETE {{ request.url_root
|
|
}}captcha/api/v1/captchas/<captcha_id> -H "X-Api-Key: {{
|
|
g.user.wallets[0].adminkey }}"
|
|
</code>
|
|
</q-card-section>
|
|
</q-card>
|
|
</q-expansion-item>
|
|
</q-expansion-item>
|