question

se avatar image
se asked

Update Player Statistic with decimal number value causes cryptic error

We recentently started noticing that one of our highscorelists did not update properly. After digging around we found that the lists, which also has a space and numbers in the name, was not being updated even though the request looked good.

Our request looks like this, notice the StatisticName and Value.

```

{

PlayFabId: "THEPLAYFABIDHERE123",

Statistics: [{

StatisticName: "24H challenge",

Value: 370573.3359375

}]

}

```

With this data we received the following error:

```

code: 400,

status: "BadRequest",

error: "InvalidParams",

errorCode: 1000,

errorMessage: "Invalid input parameters",

errorHash: null,

errorDetails: "{StatitsticName: ["The StatisticName field is required."]}",

```

When removing the decimal points (Value: 370573), but keeping the same StatisticName, we were able to update the highscore. This has not been a problem before, so perhaps a bug was recently introduced in the API?

We though you might want to know about this issue. Thanks for your great service!

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

·
Citrus Yan avatar image
Citrus Yan answered

The value for a statistic is an integer (int32) rather than a decimal, are you sure that you successfully requested with a decimal (with decimal points)as value before? If that’s the case, can you share your title id?

I think the behavior: requesting with a decimal, in this case, 370573.3359375, returns “Invalid input parameters” as errorMessage is reasonable, however, the errorDetails saying “{StatitsticName: ["The StatisticName field is required."]}” is confusing, which is something we may need to fix. Thanks for your feedback.

1 comment
10 |1200

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

se avatar image se commented ·

Slow to respond here, but thanks for the reply. What I described above used to work, and then it stopped. I agree that we were mistakenly sending floats, and we stopped doing that when we realized it, but still, this used to work.

0 Likes 0 ·

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.