From 732d4c9a39d2012ad7a280b986cf980386d97834 Mon Sep 17 00:00:00 2001 From: erentar Date: Wed, 19 Jun 2024 02:00:41 +0200 Subject: [PATCH] intro: add curl example to add new video to download queue --- mkdocs/docs/api/introduction.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mkdocs/docs/api/introduction.md b/mkdocs/docs/api/introduction.md index 55d295c..54793ca 100644 --- a/mkdocs/docs/api/introduction.md +++ b/mkdocs/docs/api/introduction.md @@ -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// \ - -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: