/upload-tokens
Retrieve a list of all currently active delegated tokens.
sortBy
string
Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ATOM UTC format.
sortOrder
string
Allowed: asc, desc. Ascending is 0-9 or A-Z. Descending is 9-0 or Z-A.
currentPage
int
Choose the number of search results to return per page. Minimum value: 1
pageSize
int
Results per page. Allowed values 1-100, default is 25.
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/UploadTokensApi.md#list
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
uploadToken := "to1tcmSFHeYY5KzyhOqVKMKb" // string | The unique identifier for the token you want information about.
res, err := client.UploadTokens.GetToken(uploadToken)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UploadTokens.GetToken``: %v\
", err)
}
// response from `GetToken`: UploadToken
fmt.Fprintf(os.Stdout, "Response from `UploadTokens.GetToken`: %v\
", res)
}
Success
{
"data": [
{
"token": "to37YfoPDRR2pcDKa6LsUE0M",
"ttl": 3600,
"createdAt": "2020-12-02T10:26:46+00:00",
"expiresAt": "2020-12-02T11:26:46+00:00"
},
{
"token": "to1W3ZS9PdUBZWzzTEZr1B79",
"ttl": 0,
"createdAt": "2020-12-02T10:26:28+00:00"
}
],
"pagination": {
"currentPage": 1,
"currentPageItems": 2,
"pageSize": 25,
"pagesTotal": 1,
"itemsTotal": 2,
"links": [
{
"rel": "self",
"uri": "/upload-tokens?currentPage=1&pageSize=25"
},
{
"rel": "first",
"uri": "/upload-tokens?currentPage=1&pageSize=25"
},
{
"rel": "last",
"uri": "/upload-tokens?currentPage=1&pageSize=25"
}
]
}
}
/upload-tokens
Generates an upload token that can be used to replace the API Key. More information can be found here
ttl
int
Time in seconds that the token will be active. A value of 0 means that the token has no exipration date. The default is to have no expiration.
{
"ttl": 3600
}
Success
{
"token": "to1tcmSFHeYY5KzyhOqVKMKb",
"ttl": 3600,
"createdAt": "2020-12-02T10:13:19+00:00",
"expiresAt": "2020-12-02T11:13:19+00:00"
}
/upload-tokens/{uploadToken}
Retrieve details about a specific upload token by id.
uploadToken
string
required
The unique identifier for the token you want information about.
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/UploadTokensApi.md#getToken
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
uploadToken := "to1tcmSFHeYY5KzyhOqVKMKb" // string | The unique identifier for the token you want information about.
res, err := client.UploadTokens.GetToken(uploadToken)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UploadTokens.GetToken``: %v\
", err)
}
// response from `GetToken`: UploadToken
fmt.Fprintf(os.Stdout, "Response from `UploadTokens.GetToken`: %v\
", res)
}
Success
{
"token": "to1tcmSFHeYY5KzyhOqVKMKb",
"ttl": 0,
"createdAt": "2020-12-02T10:13:19+00:00"
}
/upload-tokens/{uploadToken}
Delete an existing upload token. This is especially useful for tokens you may have created that do not expire.
uploadToken
string
required
The unique identifier for the upload token you want to delete. Deleting a token will make it so the token can no longer be used for authentication.
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/UploadTokensApi.md#deleteToken
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
uploadToken := "to1tcmSFHeYY5KzyhOqVKMKb" // string | The unique identifier for the upload token you want to delete. Deleting a token will make it so the token can no longer be used for authentication.
err := client.UploadTokens.DeleteToken(uploadToken)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UploadTokens.DeleteToken``: %v\
", err)
}
}
No Content
Empty response
Was this page helpful?