Guest Accounts
You can create a Ready Player Me Guest Account for every user on your end. That is helpful when you want to store the state of the avatars and assets for your users without them having a Ready Player Me account. This also reduces friction in the user experience.
- Get your application idFor the request, you need an
application id
. Therefore, you must be signed up in Studio (https://studio.readyplayer.me) and click on the application. You will find the app-id in the header of the application page. - Server Component The endpoints should be called from a server to keep your API Key secure. So we recommend you set up a server component and have all guest-account creation logic connected to your user management in the backend.
- Get your API Key This can be found within Ready Player Me Studio on the left hand navigation panel or directly here. You will need the API Key for all API-Requests. See authorizing requests.
With an API call, you can create a guest account. You will be returned a user-id for an account that has already authorized your application to create/modify avatars.
POST Request to create a user
POST
https://api.readyplayer.me/v1/users
Request body:
{
"data": {
"applicationId": "{your-application-id}"
}
}
Response:
{
"data": {
"partners": [
"{{your-partner-name}}"
],
"applicationIds": [
"{{your-application-id}}"
],
"createdAt": "2023-03-01T15:57:15.517Z",
"updatedAt": "2023-03-01T15:57:15.517Z",
"id": "63ff75dbb63b7b5808ab07e0" // userId for the created user
}
}
For users with a guest account, it is also possible to sign in with their existing Ready Player Me account. They will be asked to transfer their avatars and assets from the guest account to their Ready Player Me account.
After clicking on the Sign-In button, the user will be prompted with this message.
The iFrame also emits the
v1.events.authorized
event with the new User-ID. You need to replace the User-ID (from your Guest-Account) with the new User-ID (from the regular Ready Player Me Account).Please note that the guest account is being marked for deletion after merging, and you will be returned a new user-id.
To successfully authorize API calls, use your organization’s API key as a value of the
X-API-Key
header:--header 'x-api-key: {your-api-key}'
Last modified 7d ago