Authenticate and refresh token quickstart

Authentication at all begins with Bearer authentication. With Bearer authentication, you authenticate with your API key, then receive a JWT (JSON Web Token) access token and a JWT refresh token. The access token lasts for one hour and allows you to access all services. When the token expires, you have two choices. You can use your API key again to get a new JWT access token and refresh token, or you can use the existing refresh token to retrieve a new token.

How you choose to implement authentication can vary when you handle it yourself, but's clients make it easy by handling all of it for you.

Choose an client

The clients offered by include:


To install your selected client, do the following:

go get
composer require api-video/php-api-client
npm install --save

...or with yarn: 
yarn add
pip install
Using Nuget
Install-Package ApiVideo


To authenticate, do the following:

  1. If you haven't, sign up for an account.

  2. Go to your dashboard and retrieve your API key, you can use the Sandbox or the Production key.

  3. Now it's time to authenticate!

package main

import (
    apivideosdk ""

func main() {
    //Connect to production environment
    client := apivideosdk.ClientBuilder("YOUR_API_TOKEN").Build()
require __DIR__ . '/vendor/autoload.php';

$apiKey = 'your API key';
$apiVideoEndpoint = '';

$httpClient = new \Symfony\Component\HttpClient\Psr18Client();
$client = new ApiVideo\Client\Client(

const ApiVideoClient = require('');

(async () => {
    try {
        const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
# Use your api key to retrieve an access token for use with the
# API. Access tokens are good for one hour.

import apivideo

api_key = "your api key here"
client = apivideo.AuthenticatedApiClient(api_key)

# If you prefer to use the sandbox environment:
# client = apivideo.AuthenticatedApiClient(api_key, production=False)


# You can view the object like this. Use this for reference and testing only.

using System.Collections.Generic;
using System.Diagnostics;
using System;
using System.IO;
using ApiVideo.Api;
using ApiVideo.Client;
using ApiVideo.Model;

namespace Example
    public class Example
        public static void Main()
            var apiKey = "YOUR_API_KEY";

            var apiVideoClient = new ApiVideoClient(apiKey);
            // if you rather like to use the sandbox environment:
            // var apiVideoClient = new ApiVideoClient(apiKey, ApiVideo.Client.Environment.SANDBOX);


After you've set up your client, you can now connect to any endpoint and refreshing your token is handled for you by each client.

Did this page help you?