Access
Connect cross-platform accounts & identity management
Profile services allow players to display information about themselves such as their Name, Location, Date of Birth, and Photos. Beyond these basic attributes, you can also create your own attributes to customize the player profiles for your game. For example, you can add attributes that include a player’s level or rank. When you add these attributes to the Profile service, that information will be displayed on each player’s profile.
Custom Attributes can be implemented using the SDK. In the sample code below four custom attributes have been added: level, rank, equipped sword, and equipped shield. When this code is implemented, these attributes will appear in each player’s profile.
{
"userId": "string",
"namespace": "string",
"firstName": "string",
"lastName": "string",
"avatarSmallUrl": "string",
"avatarUrl": "string",
"avatarLargeUrl": "string",
"status": "ACTIVE",
"language": "string",
"timeZone": "string",
"dateOfBirth": "2019-12-22",
"customAttributes": {
"level": "1",
"rank": "Grand Master",
"activeWeapon": "Copper Sword",
"activeShield": "Pot Lid"
}
}
To create a player profile, you can use the following function.
You can retrieve a player profile using the following function. This function will retrieve the player’s personal information, such as First Name, Last Name, Language, etc. Check the Get My Profile Info (opens new window) endpoint to learn more about the output.
If you need to get a player's public profile, you can use the following function. The public profile is the profile that other players see when interacting in the game. When retrieving a player’s public profile you will receive the player’s User ID, Namespace, Timezone, and Avatar URL.
Use the following function to update a player profile.
Custom attributes are parts of a UserProfile that are unique to a particular game, such as weapon type. You can create custom attributes when creating a UserProfile.
The following function can be used to update a specific custom attribute field.
You can also update multiple fields that have the desired value using the following function.
You can retrieve a player profile with its custom attributes using the following function.
Before using the Basic service (which includes the Profile service) from the SDK, you will need to initialize your server-side SDK to make you authorized and able to perform create, read, update, and delete actions.
Before using the Basic service from the Golang SDK, you will need to initialize the SDK by following the steps below:
Once completed, you can use the Golang SDK to create, read, update, or delete Basic (opens new window) service from your serverless app.
Before using the Basic service from the Python SDK, you will need to initialize the SDK by following the steps below:
Once completed, you can use the Python SDK to create, read, update, or delete Basic (opens new window) service from your serverless app.
Before using the Basic service, you will need to set some permissions. Use the following .NET namespaces:
using AccelByte.Sdk.Api.Basic.Model;
using AccelByte.Sdk.Api.Basic.Operation;
using AccelByte.Sdk.Api.Basic.Wrapper;
Before using the Basic service, you will need to set some permissions. Initialize the UserProfile wrapper from the Basic service using the following code:
UserProfile wProfile = new UserProfile(sdk);
Once completed, you can use the SDK to create, read, update, or delete player profiles.
Use the following function to create a player profile (opens new window):
Use the following function to delete a player profile (opens new window):
Use the following function to retrieve a public profile (opens new window):
Use the following function to update a player profile (opens new window):