diff options
Diffstat (limited to 'support/doc')
-rw-r--r-- | support/doc/api/openapi.yaml | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index f3edca682..ad4d58e4b 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml | |||
@@ -233,8 +233,8 @@ paths: | |||
233 | }) | 233 | }) |
234 | - lang: Shell | 234 | - lang: Shell |
235 | source: | | 235 | source: | |
236 | # pip install httpie | 236 | ## DEPENDENCIES: jq |
237 | http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos | 237 | curl -s https://peertube2.cpy.re/api/v1/accounts/{name}/videos | jq |
238 | - lang: Ruby | 238 | - lang: Ruby |
239 | source: | | 239 | source: | |
240 | require 'net/http' | 240 | require 'net/http' |
@@ -1351,8 +1351,7 @@ paths: | |||
1351 | x-code-samples: | 1351 | x-code-samples: |
1352 | - lang: Shell | 1352 | - lang: Shell |
1353 | source: | | 1353 | source: | |
1354 | ## DEPENDENCIES: httpie, jq | 1354 | ## DEPENDENCIES: jq |
1355 | # pip install httpie | ||
1356 | USERNAME="<your_username>" | 1355 | USERNAME="<your_username>" |
1357 | PASSWORD="<your_password>" | 1356 | PASSWORD="<your_password>" |
1358 | FILE_PATH="<your_file_path>" | 1357 | FILE_PATH="<your_file_path>" |
@@ -1361,19 +1360,23 @@ paths: | |||
1361 | 1360 | ||
1362 | API_PATH="https://peertube2.cpy.re/api/v1" | 1361 | API_PATH="https://peertube2.cpy.re/api/v1" |
1363 | ## AUTH | 1362 | ## AUTH |
1364 | client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id") | 1363 | client_id=$(curl -s "$API_PATH/oauth-clients/local" | jq -r ".client_id") |
1365 | client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret") | 1364 | client_secret=$(curl -s "$API_PATH/oauth-clients/local" | jq -r ".client_secret") |
1366 | token=$(http -b --form POST "$API_PATH/users/token" \ | 1365 | token=$(curl -s "$API_PATH/users/token" \ |
1367 | client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \ | 1366 | --data client_id="$client_id" \ |
1368 | username=$USERNAME \ | 1367 | --data client_secret="$client_secret" \ |
1369 | password=$PASSWORD \ | 1368 | --data grant_type=password \ |
1369 | --data response_type=code \ | ||
1370 | --data username="$USERNAME" \ | ||
1371 | --data password="$PASSWORD" \ | ||
1370 | | jq -r ".access_token") | 1372 | | jq -r ".access_token") |
1371 | ## VIDEO UPLOAD | 1373 | ## VIDEO UPLOAD |
1372 | http -b --form POST "$API_PATH/videos/upload" \ | 1374 | curl -s "$API_PATH/videos/upload" \ |
1373 | videofile@$FILE_PATH \ | 1375 | -H "Authorization: Bearer $token" \ |
1374 | channelId=$CHANNEL_ID \ | 1376 | --max-time 600 \ |
1375 | name=$NAME \ | 1377 | --form videofile=@"$FILE_PATH" \ |
1376 | "Authorization:Bearer $token" | 1378 | --form channelId=$CHANNEL_ID \ |
1379 | --form name="$NAME" | ||
1377 | /videos/imports: | 1380 | /videos/imports: |
1378 | post: | 1381 | post: |
1379 | summary: Import a video | 1382 | summary: Import a video |