question

Marcin Gajda avatar image
Marcin Gajda asked

How many previous statistic value versions is returned in PlayerProfileModel.Statistics?

I would like to use data returned in PlayFab.Server.Models.PlayerProfileModel.Statistics.

Example data:

"PlayerProfile": {
	...
	"Statistics": [
		{
			"Name": "SomeStatistic",
			"Version": 17,
			"Value": 123456
		},
		{
			"Name": "SomeStatistic",
			"Version": 18,
			"Value": 234567
		}
	]
}

How many previous statistic value versions is returned?

Is there any specific number or is it related to "Leaderboard version history retention length" limit?

Leaderboards and Statistics
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Seth Du avatar image
Seth Du answered

[Edited to clarify version history]

The statistics in PlayerProfileModel.Statistics when you are calling GetPlayerProfile only contains 2 version, which are the last iteration version and current value.

if you want to retrieve the version history information for the statistic, you can use GetPlayerStatisticVersions API: https://api.playfab.com/Documentation/Client/method/GetPlayerStatisticVersions

You can use the GetPlayerStatistics API to retrieve a specific version's value, but as stated above, only the current and one previous versions will be available by default. If you need to be able to have more old versions for your statistics, you'll want to contact our sales team via the Contact Us link, to discuss an Enterprise contract.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.