Documentation

​
​

Development

User Acquisition

Monetization

Industry

Vivox Unreal SDK

Vivox Unreal SDK

Vivox
​
​
Vivox Unreal SDK
  • Overview
  • Get started
  • Release notes
  • Developer guide
  • Tutorials
  • Reference
    • Vivox Core Unreal class model overview
    • Vivox Unreal conventions
    • Unreal API Reference Manual
    • Access Token Developer Guide
      • Access token terminology
      • Requests that require access tokens
      • Access token identifiers
      • Access token format
      • Access token examples
      • Generate a token on the client
      • Generate a token on a secure server
        • Example: C++
        • Example: C#
        • Example: Python
        • Example: JavaScript
      • Key update API
      • Access token error codes
    • Server to Server Web API Reference Guide
    • Third-party license information
  1. Vivox Unreal SDK documentation

Example: Python

How to generate Vivox access tokens using Python code.
Read time 1 minute
Last updated 8 months ago

The following code is an example of how to generate access token in Python.
#!/usr/env/python############################################### Vivox Token Generation Example - Python#############################################import base64import hashlibimport hmacimport jsondef b64url(value): """Return a base64url-encoded str without trailing ='s""" return base64.urlsafe_b64encode(value).rstrip('=')def vx_generate_token(key, issuer, exp, vxa, vxi, f, t): ## Create dictionary of claims claims = { 'iss': issuer, 'exp': exp, 'vxa': vxa, 'vxi': vxi, 'f': f, 't': t } ## Header is static - base64url encoded {} header = b64url('{}') # Can also be defined as a constant "e30" ## Encode claims payload json_payload = b64url(json.dumps(claims)) ## Join segments to prepare for signing segments = [header, json_payload] to_sign = b'.'.join(segments) ## Sign token with key and HMACSHA256 sig = hmac.new(key, to_sign, hashlib.sha256).digest() segments.append(b64url(sig)) ## Join all 3 parts of token with . and return return b'.'.join(segments)if __name__ == '__main__': ## Example usage token = vx_generate_token('secret', 'issuer', 1559359105, 'join', 123456, 'sip:.username.@domain.vivox.com', 'sip:confctl-g-channelname@domain.vivox.com') print(token)

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.


    Report a problem with this page