Sign up for free

Upload Tokens

get

List all active upload tokens

Retrieve a list of all currently active delegated tokens.

sortBystring

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.

Enum
  • createdAt
  • ttl
Example
"ttl"
sortOrderstring

Allowed: asc, desc. Ascending is 0-9 or A-Z. Descending is 9-0 or Z-A.

Enum
  • asc
  • desc
Example
"asc"
currentPageint

Choose the number of search results to return per page. Minimum value: 1

Default
1
Example
2
pageSizeint

Results per page. Allowed values 1-100, default is 25.

Default
25
Example
30

Responses

Request examples

// 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)
}

Response examples

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"
      }
    ]
  }
}
post

Generate an upload token

Generates an upload token that can be used to replace the API Key. More information can be found here

ttlint

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.

Default
0
Min
0
Max
2147483647

Responses

Request examples

{
  "ttl": 3600
}

Response examples

Success

{
  "token": "to1tcmSFHeYY5KzyhOqVKMKb",
  "ttl": 3600,
  "createdAt": "2020-12-02T10:13:19+00:00",
  "expiresAt": "2020-12-02T11:13:19+00:00"
}
get

Retrieve upload token

Retrieve details about a specific upload token by id.

uploadTokenstring

required

The unique identifier for the token you want information about.

Example
"to1tcmSFHeYY5KzyhOqVKMKb"

Responses

Request examples

// 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)
}

Response examples

Success

{
  "token": "to1tcmSFHeYY5KzyhOqVKMKb",
  "ttl": 0,
  "createdAt": "2020-12-02T10:13:19+00:00"
}
delete

Delete an upload token

Delete an existing upload token. This is especially useful for tokens you may have created that do not expire.

uploadTokenstring

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.

Example
"to1tcmSFHeYY5KzyhOqVKMKb"

Responses

Request examples

// 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)
    }
}

Response examples

No Content

Empty response

Was this page helpful?