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 Rendering

Was this helpful?

  1. REST API Tutorials

Create Avatar & Render

Tutorial on how to use the API to create an avatar and render a preview.

PreviousAPI CredentialsNextCreate Avatar & Render (fast)

Last updated 4 years ago

Was this helpful?

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:renderings write:renderings.

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 Rendering

{
  "entries": [
    {
      "id": 5754466256551936,
      "type": "renderings_preview",
      "name": "neutral",
      "url": "https://storage.googleapis.com/live-com-loomai-api-attachments/5484235973984256/MThVY01uV2tfbWlhLWF2YXRhcg==.png",
      "updated_at": "2020-04-05T16:37:57Z"
    }
    ...
  ]
}

This returns a list of attachments - including uploaded photo, rendered preview (type renderings_preview) etc.

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.

A rendered preview of created avatar is automatically created and can be resolved using the avatar ID. See for details.

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