Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: add header buttons #202

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions templates/documentation/doctave.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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:
Expand All @@ -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 \
Expand Down Expand Up @@ -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' \
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -493,6 +511,8 @@ response = videos_api.delete(videos[0]['video_id'])
print(response)
```

{% endcapture %}
{% include "_partials/code-tabs.html" content: samples %}


## Conclusion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -61,7 +63,8 @@ Using Nuget

Install-Package ApiVideo
```

{% endcapture %}
{% include "_partials/code-tabs.html" content: samples %}


## Retrieve your API key
Expand All @@ -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__' \
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions templates/documentation/vod/list-videos-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
Loading