Custom Avatar Creator
Get Assets and Icons to dress your avatar and build your avatar creator asset UI
Last updated
Get Assets and Icons to dress your avatar and build your avatar creator asset UI
Last updated
Make sure you have created an anonymous user and assigned them an avatar in the previous step. We will need the created user ID, avatar ID, and user authorization token in this section.
You will also need to know your application ID. This is accessible from the studio on your application page. If you don't have an account in the studio, then you will need to sign up. This should be selected as seen below.
All of the requests shown in this section are also visible in the public Ready Player Me Postman collection
To show all the equipable assets on the avatar-creator, you need to fetch them first. You can do this with the asset list endpoint specified below. You can authenticate a user with their token from the previous step, and you can provide a range of different query param filters to filter the returned assets. For this example, you will need to:
replace user-id in the query with an anonymous user ID you created before
replace application-id in the query with the application ID you got before from the studio
add X-APP-ID header, which has the value of your application ID
add Authorization header, which contains user authorization token as Bearer.
GET
https://api.readyplayer.me/v1/assets?filter=usable-by-user-and-app&filterApplicationId=[application-id]&filterUserId=[user-id]
More info about the rest of the parameters and responses can be seen in the API documentation: https://docs.readyplayer.me/ready-player-me/api-reference/rest-api/assets/get-list-assets
filterApplicationId
Application id from studio
filterUserId
String
User id
X-APP-ID*
String
Application id from studio
Authorization*
Bearer [token]
To sort assets by type in the editor, you can use the type
parameter from the previous step response. All of the available types for the assets are listed under the Asset entity.
Asset types are also different for each gender. So make sure that if you, e.g., want to modify a female avatar, you only download and display female assets.
At this stage, you will now have your draft avatar from the previous page, and you will have used the asset list endpoint to fetch a list of assets that you can equip. Now that we have these two components we need some way to put them together so that we can equip some of these assets to our draft avatar.
You will need an asset ID and the user avatar ID, to equip the given asset to the user.
PATCH
https://api.readyplayer.me/v2/avatars/[avatar-id]
outfit
String
id of the outfit
After making the call to add the asset to the avatar, you can then fetch this avatar as a GLB by calling the following URL with your avatar ID.
GET
https://api.readyplayer.me/v2/avatars/[avatar-id].glb?preview=true
Once your draft avatar has been equipped with all of the desired assets from the asset list endpoint, you can then move on to confirming and saving your new avatar draft. You can do this with the following endpoint:
PUT
https://api.readyplayer.me/v2/avatars/[avatar-id]
Authorization
Bearer [token]
You can now fetch your newly saved avatar from the URL below with the avatar id.
GET
https://models.readyplayer.me/[avatar-id].glb
You now have a working application with a working implementation of the Ready Player Me avatar creator that will create avatars linked to your Ready Player Me application. You can now take a look at how to import your own custom assets to your application or you can go in any direction you think makes sense for your project.