Hi all,
I have an issue which is currently blocking the way we would like to use the web iFrame integration of the avatar creator.
When I open up the editor, I have a new character in front of me which I can modify. This is good, but when I press next and export it, I am unable to load the avatar again with the avatar ID.
The steps I do:
- Create a new character.
- Press next to ‘export’ the character.
- Load the character with the following URL: Ready Player Me
With this URL I have the following parameters:
- Avatar ID: This is the ID I get when I am exporting the avatar in the iFrame.
- Token: This is the API Token which I have created for my application according to the Authentication documentation.
- Domain: Is the domain which I also have from the hub.
Is there something that I am not doing right or are there more people with the same issue ?
Hello!
If I understood correctly, the token you’re describing in your post is your API Key, which is meant to authenticate yourself in your calls to our API (for those endpoints that require authentication because they are able to modify your subdomain/avatars). That API Key should always remain private to your team.
The token you should be using is for restoring sessions, it’s a short-lived token (15 seconds). You need get it using the endpoint GET - Token. You can learn more about it here.
@Gonzalo_RPM ,
I now have the user token in the API. However, when I load the avatar with the ID that I get from the export, I still get a screen with all possible characters and not the one which I passed in the url.
I now have the URL as following:
https://DOMAIN.readyplayer.me/avatar?frameApi?token=TOKEN?id=AVATAR_ID
The weird part is that the avatar which I have created is actually in the list of avatars which are then being displayed, but when I click on it, I get a 404.
Is there something that I am doing wrong here or not ?
Are you using Guest Accounts or Account Linking? It is essential for this work. Have you checked this part of our documentation?
If you have, remember the token you get for the user is short-lived, only 15 seconds. Are you making the API call and loading the URL for the user within 15 seconds?
If this doesn’t help, we’d need more context on what you’re trying to achieve and most importantly, how. If you’re using Guest accounts/Account Linking, can you please share your logic?
Hi @Gonzalo_RPM ,
I am loading the URL directly in de iFrame and within 15 seconds. Isn’t there also a way to have a token which is alive for a longer time for testing purposes?
At the moment I have the iFrame embedded in my application. When I load / mount the component, then I am doing the API request to recieve the 15-sec token. If the token has been set I am creating the URL with the avatarID which will then be used as src for the iFrame.
However, this is not working as expected, because it is going to the ‘Characters Overview’ page instead of the character itself.
There is one thing which seems a bit weird to me. Because, when I open up the character ‘By choosing SELECT’, then I do get a 404 in my console which says that the character could not be found. After clicking, the character is being loaded in the editor even with the 404.
UPDATE:
Just tested and the 404 is gone, but the character is still not being loaded. So, the 404 is fixed, but the character is still not loading.