Loomie™ 3D Avatar Platform
  • Welcome
  • REST API Tutorials
    • API Credentials
    • Create Avatar & Render
    • Create Avatar & Render (fast)
    • Create Avatar & Download GLTF
    • Create Stickers & Animations
  • Voice2Animation SDK Tutorials
    • Unity Tutorial
    • Loom.ai Facial Rig Specification
  • Loomie SDK Tutorials
    • Deploying the Docker Image
    • Example App Walkthrough
      • Example App Full Source
  • REST API
    • Authentication
      • Authorization Code Flow
      • Authorization Code Flow with PKCE
      • Client Credentials Flow
      • Implicit Flow
      • Refresh Token Flow
      • Resource Owner Flow
    • Authorization
    • Avatars
      • List
      • Create
      • Resolve Status
      • Delete
      • Attachments
        • List
        • Resolve
      • Renderings
        • List
        • Create
        • Resolve
        • Resolve Status
    • Schema
      • Animation
      • Attachment Type
      • Dimensions
      • Quota
      • Scope
      • Status
      • Sticker
Powered by GitBook
On this page
  • 1. Authenticate
  • 2. Create Avatar
  • 3. Resolve GLTF

Was this helpful?

  1. REST API Tutorials

Create Avatar & Download GLTF

Tutorial on how to use the API to create an avatar and download its GLTF representation.

PreviousCreate Avatar & Render (fast)NextCreate Stickers & Animations

Last updated 4 years ago

Was this helpful?

GLTF is a premium feature. Please for access.

1. Authenticate

Select the appropriate oauth2 authentication flow for your use case and obtain an API access token. See for details.

For sake of simplicity of this example, you can use your to authenticate directly using the . Returns an access token on success.

If you use other authentication flows, make sure to enable read:avatars write:avatars read:features write:features read:gltf.

curl --request POST \
  --url 'https://auth.loomai.com/oauth/token' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data grant_type=http://auth0.com/oauth/grant-type/password-realm \
  --data realm=Username-Password-Authentication \
  --data username={PASSWORD} \
  --data password={USERNAME} \
  --data audience=https%3A%2F%2Fapi.loomai.com%2F \
  --data client_id={CLIENT_ID} \
  --data client_secret={CLIENT_SECRET}

2. Create Avatar

curl -X POST "https://api.loomai.com/v0.5/avatars" \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  -H "Content-Type: multipart/form-data" \
  -F "image=@{IMAGE_FILE};type=image/jpeg"

3. Resolve GLTF

curl -X GET "https://api.loomai.com/v0.5/avatars/{AVATAR_ID}/attachments" \
  -H "Authorization: Bearer {ACCESS_TOKEN}"

This returns a list of attachments - including uploaded photo, rendered preview & exported GTLF (type gltf).

{
  "entries": [
    {
      "id": 5670865657659392,
      "type": "gltf",
      "name": "",
      "url": "https://storage.googleapis.com/live-com-loomai-api-attachments/5484235973984256/model.glb",
      "updated_at": "2020-04-05T16:37:44Z"
    }
    ...
  ]
}

Post a photo of a face to create an avatar. Returns response header X-Loom-Status containing the id of created avatar if successful. See for details.

The GLTF of created avatar is automatically exported and can be resolved using the avatar ID. See for details.

Avatars > Create
Avatars > Attachments > List
contact us
Authentication
application's client credentials
oauth2 resource owner flow
scopes
Authenticate
Create Avatar
Resolve Renderings