intro: add curl example to add new video to download queue

This commit is contained in:
erentar 2024-06-19 02:00:41 +02:00
parent 6315f3ad71
commit 732d4c9a39
No known key found for this signature in database
GPG Key ID: 593FC5C0F737E573

View File

@ -19,9 +19,15 @@ This page has a generic overview with how the Tube Archivist API functions. This
API token will get automatically created, accessible on the settings page. Token needs to be passed as an authorization header with every request. Additionally session based authentication is enabled too: When you are logged into your TubeArchivist instance, you'll have access to the api in the browser for testing.
Curl example:
```shell
curl -v /api/video/<video-id>/ \
-H "Authorization: Token xxxxxxxxxx"
```sh
token="<...>"
data='{"data":[{"youtube_id": "jNQXAC9IVRw", "status":"pending"}]}'
curl \
"http://tubearchive.local:80/api/download/" \
-H "Authorization: Token $token" \
-H 'Content-Type: application/json' \
--data "$data"
```
Python requests example: