Avatar WEB API curl usage sample

This page contains a step-by-step tutorial on how to retrieve the OAuth Bearer token, create a Player, retrieve available Avatar creation and export parameters, create an avatar from a photo and download avatar's mesh, blendshapes and haircut in glb format and its textures using the curl command-line utility.

To obtain curl utility for Windows, please visit the following page: https://curl.haxx.se/windows/. Please consult your Linux/macOS distributive packaging system manual to install the curl utility.

Please note that code samples syntax is different for Windows and Linux/macOS platforms, thus see the corresponding sample section for your platform by clicking on the platform title.

Authorization

Go to https://accounts.avatarsdk.com/developer/ (create an application if you have no application yet), copy App Client ID and App Client Secret from Client Access application to the corresponding variables. Please make sure you have set Authorization Grant to Client credentials. Set the TOKEN variable to the access_token value after successful authorization. Please note, that token will expire in 36000 seconds and you will need to run the authorization procedure again.

Windows
SET "CLIENT_ID=iCM5o..."
SET "CLIENT_SECRET="S8TM5..."
curl -X POST --user "%CLIENT_ID%:%CLIENT_SECRET%" ^
     "https://api.avatarsdk.com/o/token/" ^
     -F "grant_type=client_credentials"

{
  "access_token": "PAvD64lbikgVA0GzxgKV2ZhLnPbZ8P",
  "token_type": "Bearer",
  "expires_in": 36000,
  "scope": "read write"
}

SET "TOKEN=PAvD64lbikgVA0GzxgKV2ZhLnPbZ8P"
Linux
CLIENT_ID="iCM5o..."
CLIENT_SECRET="S8TM5..."
curl -X POST --user "$CLIENT_ID:$CLIENT_SECRET" \
     "https://api.avatarsdk.com/o/token/" \
     -F "grant_type=client_credentials"

{
  "access_token": "PAvD64lbikgVA0GzxgKV2ZhLnPbZ8P",
  "token_type": "Bearer",
  "expires_in": 36000,
  "scope": "read write"
}

TOKEN="PAvD64lbikgVA0GzxgKV2ZhLnPbZ8P"

Create a Player ID

Create a Player ID that will own all future avatars. Please note, that the Player ID does not expire.

Windows
curl -H "Authorization: Bearer %TOKEN%" ^
     -X POST ^
     "https://api.avatarsdk.com/players/" ^
     -F "comment=curl sample"

{
  "url": "https://api.avatarsdk.com/players/16322807-89e3-4223-a83c-1d6afa8abd11/",
  "code": "16322807-89e3-4223-a83c-1d6afa8abd11",
  "created_on": "2020-01-14T07:09:55.976235Z",
  "comment": "curl sample"
}

SET "PLAYER=16322807-89e3-4223-a83c-1d6afa8abd11"
Linux
curl -H "Authorization: Bearer $TOKEN" \
     -X POST \
     "https://api.avatarsdk.com/players/" \
     -F "comment=curl sample"

{
  "url": "https://api.avatarsdk.com/players/16322807-89e3-4223-a83c-1d6afa8abd11/",
  "code": "16322807-89e3-4223-a83c-1d6afa8abd11",
  "created_on": "2020-01-14T07:09:55.976235Z",
  "comment": "curl sample"
}

PLAYER="16322807-89e3-4223-a83c-1d6afa8abd11"

Query available parameters

Query all available parameters for head/mobile subtype of head_2.0 pipeline. Please note, that this request is useful during parameters discovery and should be omitted during normal application workflow once you figure out which parameters fit you best.

Windows
curl -H "Authorization: Bearer %TOKEN%" ^
     -X GET ^
     "https://api.avatarsdk.com/parameters/available/head_2.0/?pipeline_subtype=head/mobile"

{
    "head/mobile": {
        "avatar_modifications": {
            "base": [
                "allow_modify_neck"
            ],
            "plus": [
                "eye_iris_color",
                "eye_sclera_color",
                "add_glare",
                "add_eyelid_shadow",
                "parametric_eyes_texture",
                "hair_color",
                "teeth_color",
                "texture_size",
                "generated_haircut_texture_size",
                "generated_haircut_faces_count",
                "remove_smile",
                "remove_glasses",
                "enhance_lighting",
                "slightly_cartoonish_texture"
            ]
        },
        "blendshapes": {
            "base": [
                "mobile_51",
                "visemes_15"
            ]
        },
        "haircuts": {
            "base": [
                "generated",
                "long_disheveled",
                "long_wavy",
                "mid_length_straight",
                "ponytail_with_bangs",
                "short_disheveled",
                "short_simple"
            ],
            "plus": [
                "afro",
                "afro_short",
                "balding",
                "balding2",
                "bob",
                "bob_parted",
                "burr_cut",
                "classic_side_part",
                "classic_tapper",
                "cowlick",
                "cowlick2",
                "crew_cut",
                "crew_cut2",
                "crew_cut3",
                "cuckoo_nest",
                "curtained_hair",
                "flattop",
                "high_volume_brushed_up",
                "long_afro",
                "long_bob",
                "long_dreads",
                "long_hair",
                "long_hair2",
                "man_bun",
                "man_bun2",
                "mid_length_curved",
                "ponytail",
                "rasta",
                "short_bob_asymmetrical_bangs",
                "short_curls",
                "short_curls2",
                "short_parted",
                "short_slick",
                "side_french_braid",
                "straight_bob_bangs",
                "top_knot",
                "wavy_shag",
                "corkscrew_curls",
                "long_crimped",
                "mid_length_ruffled",
                "mid_length_straight2",
                "mid_length_wispy",
                "roman",
                "shoulder_length",
                "very_long",
                "wavy_bob"
            ]
        },
        "model_info": {
            "plus": [
                "gender",
                "race",
                "age",
                "hair_color",
                "skin_color",
                "eye_sclera_color",
                "eye_iris_color",
                "facial_landmarks_68"
            ]
        },
        "shape_modifications": {
            "plus": [
                "cartoonish_v1.0"
            ]
        }
    }
}
Linux
curl -H "Authorization: Bearer $TOKEN" \
     -X GET \
     "https://api.avatarsdk.com/parameters/available/head_2.0/?pipeline_subtype=head/mobile"

{
    "head/mobile": {
        "avatar_modifications": {
            "base": [
                "allow_modify_neck"
            ],
            "plus": [
                "eye_iris_color",
                "eye_sclera_color",
                "add_glare",
                "add_eyelid_shadow",
                "parametric_eyes_texture",
                "hair_color",
                "teeth_color",
                "texture_size",
                "generated_haircut_texture_size",
                "generated_haircut_faces_count",
                "remove_smile",
                "remove_glasses",
                "enhance_lighting",
                "slightly_cartoonish_texture"
            ]
        },
        "blendshapes": {
            "base": [
                "mobile_51",
                "visemes_15"
            ]
        },
        "haircuts": {
            "base": [
                "generated",
                "long_disheveled",
                "long_wavy",
                "mid_length_straight",
                "ponytail_with_bangs",
                "short_disheveled",
                "short_simple"
            ],
            "plus": [
                "afro",
                "afro_short",
                "balding",
                "balding2",
                "bob",
                "bob_parted",
                "burr_cut",
                "classic_side_part",
                "classic_tapper",
                "cowlick",
                "cowlick2",
                "crew_cut",
                "crew_cut2",
                "crew_cut3",
                "cuckoo_nest",
                "curtained_hair",
                "flattop",
                "high_volume_brushed_up",
                "long_afro",
                "long_bob",
                "long_dreads",
                "long_hair",
                "long_hair2",
                "man_bun",
                "man_bun2",
                "mid_length_curved",
                "ponytail",
                "rasta",
                "short_bob_asymmetrical_bangs",
                "short_curls",
                "short_curls2",
                "short_parted",
                "short_slick",
                "side_french_braid",
                "straight_bob_bangs",
                "top_knot",
                "wavy_shag",
                "corkscrew_curls",
                "long_crimped",
                "mid_length_ruffled",
                "mid_length_straight2",
                "mid_length_wispy",
                "roman",
                "shoulder_length",
                "very_long",
                "wavy_bob"
            ]
        },
        "model_info": {
            "plus": [
                "gender",
                "race",
                "age",
                "hair_color",
                "skin_color",
                "eye_sclera_color",
                "eye_iris_color",
                "facial_landmarks_68"
            ]
        },
        "shape_modifications": {
            "plus": [
                "cartoonish_v1.0"
            ]
        }
    }
}

Query available enumerable export parameters

Query all available enumerable export parameters for the head/mobile subtype of the head_2.0 pipeline. Please note, that this request is useful during parameters discovery and should be omitted during regular application workflow once you figure out which parameters fit you best.

Windows
curl -H "Authorization: Bearer %TOKEN%" ^
     -X GET ^
     "https://api.avatarsdk.com/export_parameters/available/head_2.0/?pipeline_subtype=head/mobile"

{
    "blendshapes": [
        "mobile_51",
        "visemes_15"
    ],
    "haircuts": [
        "generated",
        "long_disheveled",
        "long_wavy",
        "mid_length_straight",
        "ponytail_with_bangs",
        "short_disheveled",
        "short_simple",
        "afro",
        "afro_short",
        "balding",
        "balding2",
        "bob",
        "bob_parted",
        "burr_cut",
        "classic_side_part",
        "classic_tapper",
        "cowlick",
        "cowlick2",
        "crew_cut",
        "crew_cut2",
        "crew_cut3",
        "cuckoo_nest",
        "curtained_hair",
        "flattop",
        "high_volume_brushed_up",
        "long_afro",
        "long_bob",
        "long_dreads",
        "long_hair",
        "long_hair2",
        "man_bun",
        "man_bun2",
        "mid_length_curved",
        "ponytail",
        "rasta",
        "short_bob_asymmetrical_bangs",
        "short_curls",
        "short_curls2",
        "short_parted",
        "short_slick",
        "side_french_braid",
        "straight_bob_bangs",
        "top_knot",
        "wavy_shag",
        "corkscrew_curls",
        "long_crimped",
        "mid_length_ruffled",
        "mid_length_straight2",
        "mid_length_wispy",
        "roman",
        "shoulder_length",
        "very_long",
        "wavy_bob"
    ]
}
Linux
curl -H "Authorization: Bearer $TOKEN" \
     -X GET \
     "https://api.avatarsdk.com/export_parameters/available/head_2.0/?pipeline_subtype=head/mobile"

{
    "blendshapes": [
        "mobile_51",
        "visemes_15"
    ],
    "haircuts": [
        "generated",
        "long_disheveled",
        "long_wavy",
        "mid_length_straight",
        "ponytail_with_bangs",
        "short_disheveled",
        "short_simple",
        "afro",
        "afro_short",
        "balding",
        "balding2",
        "bob",
        "bob_parted",
        "burr_cut",
        "classic_side_part",
        "classic_tapper",
        "cowlick",
        "cowlick2",
        "crew_cut",
        "crew_cut2",
        "crew_cut3",
        "cuckoo_nest",
        "curtained_hair",
        "flattop",
        "high_volume_brushed_up",
        "long_afro",
        "long_bob",
        "long_dreads",
        "long_hair",
        "long_hair2",
        "man_bun",
        "man_bun2",
        "mid_length_curved",
        "ponytail",
        "rasta",
        "short_bob_asymmetrical_bangs",
        "short_curls",
        "short_curls2",
        "short_parted",
        "short_slick",
        "side_french_braid",
        "straight_bob_bangs",
        "top_knot",
        "wavy_shag",
        "corkscrew_curls",
        "long_crimped",
        "mid_length_ruffled",
        "mid_length_straight2",
        "mid_length_wispy",
        "roman",
        "shoulder_length",
        "very_long",
        "wavy_bob"
    ]
}

Create an avatar

We will use the following parameters for our avatar:

{
  "model_info": {
    "plus": [
      "gender",
      "age",
      "race"
    ]
  },
  "avatar_modifications": {
    "plus": {
      "remove_smile": true,
      "remove_glasses": true,
      "enhance_lighting": true
    }
  }
}

And the following export parameters:

{
  "format": "glb",

  "blendshapes": {
    "list": ["mobile_51", "visemes_15"],
    "embed": true
  },
  "haircuts": {
    "list": ["generated", "afro"],
    "embed": false
  }
}

Please note: since we are using Exports API, haircuts and blendshapes should be specified in export parameters.

Create an avatar with the parameters above and a photo.jpg photo from the current directory (adjust path if necessary):

Windows
curl -H "Authorization: Bearer %TOKEN%" ^
     -H "X-PlayerUID: %PLAYER%" ^
     -X POST "https://api.avatarsdk.com/avatars/" ^
     -F "name=test from curl sample" ^
     -F "pipeline=head_2.0" ^
     -F "pipeline_subtype=head/mobile" ^
     -F "parameters={\"model_info\":{\"plus\":[\"gender\",\"age\",\"race\"]},\"avatar_modifications\":{\"plus\":{\"remove_smile\":true,\"remove_glasses\":true,\"enhance_lighting\":true}}}" ^
     -F "export_parameters={\"format\":\"glb\",\"blendshapes\":{\"list\":[\"mobile_51\",\"visemes_15\"],\"embed\":true},\"haircuts\":{\"list\":[\"generated\",\"afro\"],\"embed\":false}}" ^
     -F "photo=@photo.jpg"

{
  "code": "096281e9-fc9e-4b5b-bf3d-9ac68b5ca637",
  "created_on": "2020-11-24T13:39:53.490812Z",
  "description": "test from curl sample",
  "progress": 0,
  "status": "Uploading",
  "url": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/"
}

SET "AVATAR=096281e9-fc9e-4b5b-bf3d-9ac68b5ca637"
Linux
curl -H "Authorization: Bearer $TOKEN" \
     -H "X-PlayerUID: $PLAYER" \
     -X POST "https://api.avatarsdk.com/avatars/" \
     -F "name=test from curl sample" \
     -F "pipeline=head_2.0" \
     -F "pipeline_subtype=head/mobile" \
     -F "parameters={\"model_info\":{\"plus\":[\"gender\",\"age\",\"race\"]},\"avatar_modifications\":{\"plus\":{\"remove_smile\":true,\"remove_glasses\":true,\"enhance_lighting\":true}}}" \
     -F "export_parameters={\"format\":\"glb\",\"blendshapes\":{\"list\":[\"mobile_51\",\"visemes_15\"],\"embed\":true},\"haircuts\":{\"list\":[\"generated\",\"afro\"],\"embed\":false}}" \
     -F "photo=@photo.jpg"

{
  "code": "096281e9-fc9e-4b5b-bf3d-9ac68b5ca637",
  "created_on": "2020-11-24T13:39:53.490812Z",
  "description": "test from curl sample",
  "progress": 0,
  "status": "Uploading",
  "url": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/"
}

AVATAR="096281e9-fc9e-4b5b-bf3d-9ac68b5ca637"

Poll avatar status

Once the photo is uploaded avatar computation starts. Request the avatar status periodically (once per 5 seconds should be enough) to check avatar computation status and progress:

Windows
curl -H "Authorization: Bearer %TOKEN%" ^
     -H "X-PlayerUID: %PLAYER%" ^
     -X GET ^
     "https://api.avatarsdk.com/avatars/%AVATAR%/"

{
  "blendshapes": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/blendshapes/",
  "code": "096281e9-fc9e-4b5b-bf3d-9ac68b5ca637",
  "created_on": "2020-11-24T13:39:53.490812Z",
  "ctime": null,
  "description": "",
  "exports": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/exports/",
  "haircuts": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/haircuts/",
  "mesh": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/mesh/",
  "model_info": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/model_info/",
  "name": "test from curl sample",
  "pipeline": null,
  "pipeline_subtype": null,
  "preview": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/preview/",
  "progress": 0,
  "status": "Computing",
  "texture": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/texture/",
  "thumbnail": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/thumbnail/",
  "url": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/"
}
Linux
curl -H "Authorization: Bearer $TOKEN" \
     -H "X-PlayerUID: $PLAYER" \
     -X GET \
     "https://api.avatarsdk.com/avatars/$AVATAR/"

{
  "blendshapes": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/blendshapes/",
  "code": "096281e9-fc9e-4b5b-bf3d-9ac68b5ca637",
  "created_on": "2020-11-24T13:39:53.490812Z",
  "ctime": null,
  "description": "",
  "exports": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/exports/",
  "haircuts": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/haircuts/",
  "mesh": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/mesh/",
  "model_info": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/model_info/",
  "name": "test from curl sample",
  "pipeline": null,
  "pipeline_subtype": null,
  "preview": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/preview/",
  "progress": 0,
  "status": "Computing",
  "texture": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/texture/",
  "thumbnail": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/thumbnail/",
  "url": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/"
}

Once the avatar is ready, its status is set to Completed and progress is 100:

Windows
curl -H "Authorization: Bearer %TOKEN%" ^
     -H "X-PlayerUID: %PLAYER%" ^
     -X GET ^
     "https://api.avatarsdk.com/avatars/%AVATAR%/"

{
  "blendshapes": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/blendshapes/",
  "code": "096281e9-fc9e-4b5b-bf3d-9ac68b5ca637",
  "created_on": "2020-11-24T13:39:53.490812Z",
  "ctime": null,
  "description": "",
  "exports": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/exports/",
  "haircuts": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/haircuts/",
  "mesh": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/mesh/",
  "model_info": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/model_info/",
  "name": "test from curl sample",
  "pipeline": "head_2.0",
  "pipeline_subtype": "head/mobile",
  "preview": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/preview/",
  "progress": 100,
  "status": "Completed",
  "texture": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/texture/",
  "thumbnail": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/thumbnail/",
  "url": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/"
}
Linux
curl -H "Authorization: Bearer $TOKEN" \
     -H "X-PlayerUID: $PLAYER" \
     -X GET \
     "https://api.avatarsdk.com/avatars/$AVATAR/"

{
  "blendshapes": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/blendshapes/",
  "code": "096281e9-fc9e-4b5b-bf3d-9ac68b5ca637",
  "created_on": "2020-11-24T13:39:53.490812Z",
  "ctime": null,
  "description": "",
  "exports": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/exports/",
  "haircuts": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/haircuts/",
  "mesh": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/mesh/",
  "model_info": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/model_info/",
  "name": "test from curl sample",
  "pipeline": "head_2.0",
  "pipeline_subtype": "head/mobile",
  "preview": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/preview/",
  "progress": 100,
  "status": "Completed",
  "texture": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/texture/",
  "thumbnail": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/thumbnail/",
  "url": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/"
}

Check avatar export

Once the avatar is ready, check avatar exports status:

Windows
curl -H "Authorization: Bearer %TOKEN%" ^
     -H "X-PlayerUID: %PLAYER%" ^
     -X GET ^
     "https://api.avatarsdk.com/avatars/%AVATAR%/exports/"

[
  {
    "status": "Completed",
    "files": [
      {
        "category": "haircuts",
        "static_files": [],
        "identity": "generated",
        "file": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/exports/bd051c28-d0f3-4fd4-b82d-f3428ab36213/files/generated/file/"
      },
      {
        "category": "haircuts",
        "static_files": [
          "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/exports/bd051c28-d0f3-4fd4-b82d-f3428ab36213/files/afro/static_files/afro.png"
        ],
        "identity": "afro",
        "file": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/exports/bd051c28-d0f3-4fd4-b82d-f3428ab36213/files/afro/file/"
      },
      {
        "category": null,
        "static_files": [
          "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/exports/bd051c28-d0f3-4fd4-b82d-f3428ab36213/files/avatar/static_files/outfit_1.png",
          "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/exports/bd051c28-d0f3-4fd4-b82d-f3428ab36213/files/avatar/static_files/outfit_0.png"
        ],
        "identity": "avatar",
        "file": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/exports/bd051c28-d0f3-4fd4-b82d-f3428ab36213/files/avatar/file/"
      }
    ],
    "code": "bd051c28-d0f3-4fd4-b82d-f3428ab36213",
    "url": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/exports/bd051c28-d0f3-4fd4-b82d-f3428ab36213/",
    "created_on": "2020-11-24T13:55:25.831538Z",
    "avatar_code": "096281e9-fc9e-4b5b-bf3d-9ac68b5ca637"
  }
]

SET "EXPORT=bd051c28-d0f3-4fd4-b82d-f3428ab36213"
Linux
curl -H "Authorization: Bearer $TOKEN" \
     -H "X-PlayerUID: $PLAYER" \
     -X GET \
     "https://api.avatarsdk.com/avatars/$AVATAR/exports/"

[
  {
    "status": "Completed",
    "files": [
      {
        "category": "haircuts",
        "static_files": [],
        "identity": "generated",
        "file": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/exports/bd051c28-d0f3-4fd4-b82d-f3428ab36213/files/generated/file/"
      },
      {
        "category": "haircuts",
        "static_files": [
          "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/exports/bd051c28-d0f3-4fd4-b82d-f3428ab36213/files/afro/static_files/afro.png"
        ],
        "identity": "afro",
        "file": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/exports/bd051c28-d0f3-4fd4-b82d-f3428ab36213/files/afro/file/"
      },
      {
        "category": null,
        "static_files": [],
        "identity": "avatar",
        "file": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/exports/bd051c28-d0f3-4fd4-b82d-f3428ab36213/files/avatar/file/"
      }
    ],
    "code": "bd051c28-d0f3-4fd4-b82d-f3428ab36213",
    "url": "https://api.avatarsdk.com/avatars/096281e9-fc9e-4b5b-bf3d-9ac68b5ca637/exports/bd051c28-d0f3-4fd4-b82d-f3428ab36213/",
    "created_on": "2020-11-24T13:55:25.831538Z",
    "avatar_code": "096281e9-fc9e-4b5b-bf3d-9ac68b5ca637"
  }
]

EXPORT="bd051c28-d0f3-4fd4-b82d-f3428ab36213"

Download avatar export files

Once the avatar export is ready, download all its files: avatar mesh with blendshapes in one unified glb (as requested per export parameters), generated haircut, and afro haircut with one static file (haircut texture). Please note: avatar info (requested in avatar computation parameters) is available within the model.json file in the avatar.zip archive.

Windows
curl -H "Authorization: Bearer %TOKEN%" ^
     -H "X-PlayerUID: %PLAYER%" ^
     -X GET ^
     "https://api.avatarsdk.com/avatars/%AVATAR%/exports/%EXPORT%/files/avatar/file/" ^
     -o "avatar.zip"

curl -H "Authorization: Bearer %TOKEN%" ^
     -H "X-PlayerUID: %PLAYER%" ^
     -X GET ^
     "https://api.avatarsdk.com/avatars/%AVATAR%/exports/%EXPORT%/files/generated/file/" ^
     -o "generated.zip"

curl -H "Authorization: Bearer %TOKEN%" ^
     -H "X-PlayerUID: %PLAYER%" ^
     -X GET ^
     "https://api.avatarsdk.com/avatars/%AVATAR%/exports/%EXPORT%/files/afro/file/" ^
     -o "afro.zip"

curl -H "Authorization: Bearer %TOKEN%" ^
     -H "X-PlayerUID: %PLAYER%" ^
     -X GET ^
     "https://api.avatarsdk.com/avatars/%AVATAR%/exports/%EXPORT%/files/afro/static_files/afro.png" ^
     -o "afro.png"
Linux
curl -H "Authorization: Bearer $TOKEN" \
     -H "X-PlayerUID: $PLAYER" \
     -X GET \
     "https://api.avatarsdk.com/avatars/$AVATAR/exports/$EXPORT/files/avatar/file/" \
     -o "avatar.zip"

curl -H "Authorization: Bearer $TOKEN" \
     -H "X-PlayerUID: $PLAYER" \
     -X GET \
     "https://api.avatarsdk.com/avatars/$AVATAR/exports/$EXPORT/files/generated/file/" \
     -o "generated.zip"

curl -H "Authorization: Bearer $TOKEN" \
     -H "X-PlayerUID: $PLAYER" \
     -X GET \
     "https://api.avatarsdk.com/avatars/$AVATAR/exports/$EXPORT/files/afro/file/" \
     -o "afro.zip"

curl -H "Authorization: Bearer $TOKEN" \
     -H "X-PlayerUID: $PLAYER" \
     -X GET \
     "https://api.avatarsdk.com/avatars/$AVATAR/exports/$EXPORT/files/afro/static_files/afro.png" \
     -o "afro.png"