diff --git a/templates/documentation/doctave.yaml b/templates/documentation/doctave.yaml index b74f2417..7963e4e4 100644 --- a/templates/documentation/doctave.yaml +++ b/templates/documentation/doctave.yaml @@ -1,5 +1,16 @@ --- title: api.video documentation +header: + links: + - external: https://community.api.video/ + text: Community + - external: https://help.api.video/en/ + text: Help Center + - external: https://api.video/changelog/ + text: Changelog + cta: + external: https://dashboard.api.video/register + text: Sign up for free colors: main: "#FA5B30" diff --git a/templates/documentation/get-started/create-and-manage-tokens-for-delegated-uploads.md b/templates/documentation/get-started/create-and-manage-tokens-for-delegated-uploads.md index 1ff43540..03322bef 100644 --- a/templates/documentation/get-started/create-and-manage-tokens-for-delegated-uploads.md +++ b/templates/documentation/get-started/create-and-manage-tokens-for-delegated-uploads.md @@ -37,6 +37,8 @@ The clients offered by api.video include: To install your selected client, do the following: +{% capture samples %} + ```go go get github.com/apivideo/api.video-go-client ``` @@ -59,6 +61,9 @@ Using Nuget Install-Package ApiVideo ``` +{% endcapture %} +{% include "_partials/code-tabs.html" content: samples %} + ## Retrieve your API key You'll need your API key to get started. You can sign up for one here: [Get your api.video API key!](https://dashboard.api.video/register). Then do the following: @@ -72,6 +77,8 @@ You'll need your API key to get started. You can sign up for one here: [Get your Use this code sample to generate a token for use with a delegated upload. You can include a TTL (time-to-live) if you like. The token will expire after exceeding the set TTL. If you don't send in a TTL, your token will last until you choose to delete it. +{% capture samples %} + ```curl curl --request POST \ --url https://ws.api.video/upload-tokens \ @@ -174,12 +181,15 @@ response = tokens_api.create_token(token_creation_payload) print(response) ``` - +{% endcapture %} +{% include "_partials/code-tabs.html" content: samples %} ## List all tokens you created If a token is compromised, or you want to see how many tokens you have, you will need to retrieve a list of them programmatically. Here is the code sample for that: +{% capture samples %} + ```curl curl --request GET \ --url 'https://ws.api.video/upload-tokens?currentPage=1&pageSize=25' \ @@ -281,12 +291,16 @@ response = tokens_api.list() print(response) ``` +{% endcapture %} +{% include "_partials/code-tabs.html" content: samples %} ## Show details about a specific token Retrieve information about a specific token. To do this, you send a request containing the token ID for the token you need details about. +{% capture samples %} + ```curl curl --request GET \ --url https://ws.api.video/upload-tokens/to40nBwUZJGnuW8THBZwPqtL \ @@ -384,12 +398,16 @@ response = tokens_api.get_token(token) print(response) ``` +{% endcapture %} +{% include "_partials/code-tabs.html" content: samples %} ## Delete a token If you create a token that's compromised, you may want to remove it. Or, you might want to clean up how many tokens you have in general. All you need to do to delete a token is send a request containing the token ID for the token you want to remove. +{% capture samples %} + ```curl curl --request DELETE \ --url https://ws.api.video/upload-tokens/curl%20--request%20GET%20%5C%20%20%20%20%20%20--url%20https%3A%2F%2Fws.api.video%2Fupload-tokens%2Fto40nBwUZJGnuW8THBZwPqtL%20%5C%20%20%20%20%20%20--header%20%27Accept%3A%20application%2Fjson%27%20%5C%20%20%20%20%20%20--header%20%27Authorization%3A%20Bearer%20eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE2NDI4MTQxNDUuMjE2Mzc2LCJuYmYiOjE2NDI4MTQxNDUuMjE2Mzc2LCJleHAiOjE2NDI4MTc3NDUuMjE2Mzc2LCJwcm9qZWN0SWQiOiJwclJ6SUpKQTdCTHNxSGpTNDVLVnBCMSJ9.GSDqqMzBxo-wOwl9IVbOnzevm8A6LSyaR5kxCWUdkEneSU0kIdoNfhwmXZBq5QWpVa-0GIT8JR59W6npNO-ayhaXmV3LA6EQpvv0mHd_dAhg3N8T96eC0ps0YIrkmw0_Oe6iRgEDI-wJ9nc6tQWi9ybbMHi1LDBjxW4rbFlq7G59C1QZGabd14QO7uqAUUSNqHC1l42z_m7BTK1AhFiBEXmMcfW7X0VmGcaEUy7NiNda8rmq_nrdvkxgN8KHguXzxMsw_4GE_d0eQwHcZvS1q-FebI6b8AoqpoltFOZvUACCrfXH_D_UPshHuJM3apXbD2dg_zQicc8oWBHVGiobLQ%27 \ @@ -493,6 +511,8 @@ response = videos_api.delete(videos[0]['video_id']) print(response) ``` +{% endcapture %} +{% include "_partials/code-tabs.html" content: samples %} ## Conclusion diff --git a/templates/documentation/get-started/upload-a-video-with-a-delegated-token.md b/templates/documentation/get-started/upload-a-video-with-a-delegated-token.md index 6c8160c5..74f4492d 100644 --- a/templates/documentation/get-started/upload-a-video-with-a-delegated-token.md +++ b/templates/documentation/get-started/upload-a-video-with-a-delegated-token.md @@ -40,6 +40,8 @@ The clients offered by api.video include: To install your selected client, do the following: +{% capture samples %} + ```go go get github.com/apivideo/api.video-go-client ``` @@ -61,7 +63,8 @@ Using Nuget Install-Package ApiVideo ``` - +{% endcapture %} +{% include "_partials/code-tabs.html" content: samples %} ## Retrieve your API key @@ -77,6 +80,8 @@ You'll need your API key to get started. You can sign up for one here: [Get your You must first create a token and get the unique token ID to do a delegated upload. Then, you include it in your request as a query parameter. In the body, you place the path to the file you want to upload. If you are uploading a file that's 200 MiB or larger, to do a progressive upload, you will need to break the file into smaller pieces (no smaller than 5 MiB). Then send a request containing the first piece of your upload. Subsequent pieces must be sent with the video ID included in the body along with the file chunk. Retrieve the video ID from the response that comes back after your first request to upload. +{% capture samples %} + ```curl curl --request POST \ --url 'https://ws.api.video/upload?token=__TOKENIDHERE__' \ @@ -178,7 +183,8 @@ response = videos_api.upload_with_upload_token(token, file) print(response) © 2022 GitHub, Inc. ``` - +{% endcapture %} +{% include "_partials/code-tabs.html" content: samples %} ## Conclusion diff --git a/templates/documentation/vod/list-videos-2.md b/templates/documentation/vod/list-videos-2.md index b01b7adf..2c7b8905 100644 --- a/templates/documentation/vod/list-videos-2.md +++ b/templates/documentation/vod/list-videos-2.md @@ -53,7 +53,7 @@ Using Nuget Install-Package ApiVideo ``` {% endcapture %} -{% include "_partials/code-tabs.html" samples: content %} +{% include "_partials/code-tabs.html" content: samples %} ## List all videos @@ -148,7 +148,7 @@ videos = videos_api.list() print(videos) ``` {% endcapture %} -{% include "_partials/code-tabs.html" samples: content %} +{% include "_partials/code-tabs.html" content: samples %} ## List videos using query parameters @@ -262,7 +262,7 @@ videos = videos_api.list(title='your title') print(videos) ``` {% endcapture %} -{% include "_partials/code-tabs.html" samples: content %} +{% include "_partials/code-tabs.html" content: samples %} ## See a list of videos in the dashboard