Service APIs for creating virtual avatars
  • Welcome
    • Overview
    • About us
    • Glossary
  • What's New
    • Changelog
    • Subscribe for updates
  • EXAMPLES
    • 3D model from single photo
  • Getting started
    • Introduction
    • Getting a token
    • 3D Face Reconstruction
    • 3D Hair Reconstruction
    • GLB Constructor
      • Easy - Head Visualization
      • Advanced - Schema preparation
      • Advanced - Assembling
  • API Methods
    • 3D Face Reconstruction
      • Bad Case Examples
    • 3D Hair Reconstruction
    • GLB Constructor
  • Errors
    • 3D Face Reconstruction
    • 3D Hair Reconstruction
    • GLB Constructor
  • API Metrics
    • SLA
Powered by GitBook
On this page
  1. Getting started

Getting a token

PreviousIntroductionNext3D Face Reconstruction

Last updated 1 year ago

In order to access our API, you must obtain an access token when authenticating a user. Once the token is generated, copy its value and save it in a secure place, since you will not be able to retrieve it again.

To generate an access token, you must send a POST request using the .

name="ENTER_YOUR_NAME"
email="ENTER_YOUR_EMAIL"
comment="ENTER_YOUR_COMMENT"

curl -X 'POST' \
  'https://api.metahumansdk.io/auth/token' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'name=${name}&mail=${email}&comment=${comment}'
import requests

name = "ENTER_YOUR_NAME"
email = "ENTER_YOUR_EMAIL"
comment = "ENTER_YOUR_COMMENT"

def print_token():
    service_url = "http://api.metahumansdk.io/auth"
    service_headers = {"accept": "application/json"}
    data = {
        "name": name,
        "mail": email,
        "comment": comment
    }
    response = requests.post(service_url + "/token", headers=service_headers, data=data)
    assert (response.status_code == 200)
    
    print(response.json())

if __name__ == "__main__":
    print_token()

Expected output:

{'result': {'token': '5775d7ad-d1d3-4aea-83cf-1c14512f70cc'}}

Note: Do not forget to replace the details in the request with your own.

We promise not to spam you and keep your email private, you will only receive important updates from us.

token URL