Avatar WEB API curl usage sample

Contents

This page contains a step-by-step tutorial on how to retrieve OAuth Bearer token, create an selfie upload page, poll selfie file status, create a Player, create an avatar from selfie, poll its status and download its mesh, texture, blendshapes, haircuts and avatar info 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 help to install curl utility.

Please note that code samples syntax is different for Windows and for 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"

Create a selfie upload page

Create a selfie upload page that end-user should visit to upload his or her photo:

Selfie upload page sample workflow
Windows
curl -H "Authorization: Bearer %TOKEN%" ^
     -X POST ^
     "https://api.avatarsdk.com/selfies/"

{
  "code": "5782faea-7762-4170-b5f0-d74b0e49d924",
  "expires": "2020-12-24T07:36:48.295675Z",
  "file_url": "https://api.avatarsdk.com/selfies/5782faea-7762-4170-b5f0-d74b0e49d924/file/",
  "upload_page_qr": "https://api.avatarsdk.com/selfies/5782faea-7762-4170-b5f0-d74b0e49d924/qr/",
  "upload_page_url": "https://accounts.avatarsdk.com/dashboard/selfie/5782faea-7762-4170-b5f0-d74b0e49d924/",
  "upload_page_visited": false,
  "url": "https://api.avatarsdk.com/selfies/5782faea-7762-4170-b5f0-d74b0e49d924/"
}

SET "SELFIE=5782faea-7762-4170-b5f0-d74b0e49d924"
Linux
curl -H "Authorization: Bearer $TOKEN" \
     -X POST \
     "https://api.avatarsdk.com/selfies/"

{
  "code": "5782faea-7762-4170-b5f0-d74b0e49d924",
  "expires": "2020-12-24T07:36:48.295675Z",
  "file_url": "https://api.avatarsdk.com/selfies/5782faea-7762-4170-b5f0-d74b0e49d924/file/",
  "upload_page_qr": "https://api.avatarsdk.com/selfies/5782faea-7762-4170-b5f0-d74b0e49d924/qr/",
  "upload_page_url": "https://accounts.avatarsdk.com/dashboard/selfie/5782faea-7762-4170-b5f0-d74b0e49d924/",
  "upload_page_visited": false,
  "url": "https://api.avatarsdk.com/selfies/5782faea-7762-4170-b5f0-d74b0e49d924/"
}

SELFIE="5782faea-7762-4170-b5f0-d74b0e49d924"

Retrieve a QR code with selfie upload page URL

Retrieve ready to display QR code image in PNG file format:

QR code sample
Windows
curl -H "Authorization: Bearer %TOKEN%" ^
     -X GET ^
     "https://api.avatarsdk.com/selfies/%SELFIE%/qr/" ^
     -o "qr.png"
Linux
curl -H "Authorization: Bearer $TOKEN" \
     -X GET \
     "https://api.avatarsdk.com/selfies/$SELFIE/qr/" \
     -o "qr.png"

Poll selfie status

Request the selfie file status periodically (once per 5 seconds should be enough) to check whether it was uploaded:

Windows
curl -H "Authorization: Bearer %TOKEN%" ^
     -X HEAD -i ^
     "https://api.avatarsdk.com/selfies/%SELFIE%/file/"

HTTP/1.0 204 NO CONTENT
Linux
curl -H "Authorization: Bearer $TOKEN" \
     -X HEAD -i \
     "https://api.avatarsdk.com/selfies/$SELFIE/file/"

HTTP/1.0 204 NO CONTENT

Once the selfie photo is uploaded, HTTP 200 is returned:

Windows
curl -H "Authorization: Bearer %TOKEN%" ^
     -X HEAD -i ^
     "https://api.avatarsdk.com/selfies/%SELFIE%/file/"

HTTP/1.0 200 OK
Linux
curl -H "Authorization: Bearer $TOKEN" \
     -X HEAD -i \
     "https://api.avatarsdk.com/selfies/$SELFIE/file/"

HTTP/1.0 200 OK

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"],
    "embed": true
  }
}

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

Save avatar parameters and export parameters into the files parameters.json and export_parameters.json correspondingly. Create an avatar with the parameters files above and the selfie uploaded earlier:

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=<parameters.json" ^
     -F "export_parameters=<export_parameters.json" ^
     -F "selfie=%SELFIE%"

{
  "url": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/",
  "code": "0c60a909-2e5b-4c49-9365-368b4cf78d43",
  "status": "Uploading",
  "progress": 0,
  "created_on": "2020-01-14T07:44:12.554903Z",
  "name": "test from curl sample",
  "description": ""
}

SET "AVATAR=0c60a909-2e5b-4c49-9365-368b4cf78d43"
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=<parameters.json" \
     -F "export_parameters=<export_parameters.json" \
     -F "selfie=$SELFIE"

{
  "url": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/",
  "code": "0c60a909-2e5b-4c49-9365-368b4cf78d43",
  "status": "Uploading",
  "progress": 0,
  "created_on": "2020-01-14T07:44:12.554903Z",
  "name": "test from curl sample",
  "description": ""
}

AVATAR="0c60a909-2e5b-4c49-9365-368b4cf78d43"

Poll avatar status

Once the photo is uploaded avatar computation is started. 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%/"

{
  "url": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/",
  "code": "0c60a909-2e5b-4c49-9365-368b4cf78d43",
  "status": "Computing",
  "progress": 0,
  "name": "test from curl sample",
  "description": "",
  "created_on": "2020-01-14T07:44:12.554903Z",
  "ctime": null,
  "model_info": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/model_info/",
  "thumbnail": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/thumbnail/",
  "mesh": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/mesh/",
  "texture": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/texture/",
  "preview": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/preview/",
  "haircuts": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/haircuts/",
  "blendshapes": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/blendshapes/",
  "exports": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/exports/",
  "pipeline": null,
  "pipeline_subtype": null
}
Linux
curl -H "Authorization: Bearer $TOKEN" \
     -H "X-PlayerUID: $PLAYER" \
     -X GET \
     "https://api.avatarsdk.com/avatars/$AVATAR/"

{
  "url": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/",
  "code": "0c60a909-2e5b-4c49-9365-368b4cf78d43",
  "status": "Computing",
  "progress": 0,
  "name": "test from curl sample",
  "description": "",
  "created_on": "2020-01-14T07:44:12.554903Z",
  "ctime": null,
  "model_info": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/model_info/",
  "thumbnail": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/thumbnail/",
  "mesh": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/mesh/",
  "texture": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/texture/",
  "preview": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/preview/",
  "haircuts": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/haircuts/",
  "blendshapes": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/blendshapes/",
  "exports": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/exports/",
  "pipeline": null,
  "pipeline_subtype": null
}

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%/"

{
  "url": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/",
  "code": "0c60a909-2e5b-4c49-9365-368b4cf78d43",
  "status": "Completed",
  "progress": 100,
  "name": "test from curl sample",
  "description": "",
  "created_on": "2020-01-14T07:44:12.554903Z",
  "ctime": null,
  "model_info": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/model_info/",
  "thumbnail": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/thumbnail/",
  "mesh": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/mesh/",
  "texture": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/texture/",
  "preview": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/preview/",
  "haircuts": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/haircuts/",
  "blendshapes": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/blendshapes/",
  "exports": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/exports/",
  "pipeline": "head_2.0",
  "pipeline_subtype": "head/mobile"
}
Linux
curl -H "Authorization: Bearer $TOKEN" \
     -H "X-PlayerUID: $PLAYER" \
     -X GET \
     "https://api.avatarsdk.com/avatars/$AVATAR/"

{
  "url": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/",
  "code": "0c60a909-2e5b-4c49-9365-368b4cf78d43",
  "status": "Completed",
  "progress": 100,
  "name": "test from curl sample",
  "description": "",
  "created_on": "2020-01-14T07:44:12.554903Z",
  "ctime": null,
  "model_info": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/model_info/",
  "thumbnail": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/thumbnail/",
  "mesh": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/mesh/",
  "texture": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/texture/",
  "preview": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/preview/",
  "haircuts": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/haircuts/",
  "blendshapes": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/blendshapes/",
  "exports": "https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/exports/",
  "pipeline": "head_2.0",
  "pipeline_subtype": "head/mobile"
}

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/"

[
  {
    "code":"c9a4de2d-5702-465c-9f1b-4ef413465877",
    "avatar_code":"0c60a909-2e5b-4c49-9365-368b4cf78d43",
    "status":"Completed",
    "created_on":"2020-01-14T07:44:25.919886Z",
    "files":[
      {
        "category":null,
        "static_files":[],
        "file":"https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/exports/c9a4de2d-5702-465c-9f1b-4ef413465877/files/avatar/file/",
        "identity":"avatar"
      }
    ],
    "url":"https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/exports/c9a4de2d-5702-465c-9f1b-4ef413465877/"
  }
]

SET "EXPORT=c9a4de2d-5702-465c-9f1b-4ef413465877"
Linux
curl -H "Authorization: Bearer $TOKEN" \
     -H "X-PlayerUID: $PLAYER" \
     -X GET \
     "https://api.avatarsdk.com/avatars/$AVATAR/exports/"

[
  {
    "code":"c9a4de2d-5702-465c-9f1b-4ef413465877",
    "avatar_code":"0c60a909-2e5b-4c49-9365-368b4cf78d43",
    "status":"Completed",
    "created_on":"2020-01-14T07:44:25.919886Z",
    "files":[
      {
        "category":null,
        "static_files":[],
        "file":"https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/exports/c9a4de2d-5702-465c-9f1b-4ef413465877/files/avatar/file/",
        "identity":"avatar"
      }
    ],
    "url":"https://api.avatarsdk.com/avatars/0c60a909-2e5b-4c49-9365-368b4cf78d43/exports/c9a4de2d-5702-465c-9f1b-4ef413465877/"
  }
]

EXPORT="c9a4de2d-5702-465c-9f1b-4ef413465877"

Download avatar export file

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

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"
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"