question

Larry Dietz avatar image
Larry Dietz asked

Receiving an error updating statistics

I am trying to make an update to a statistic from CloudScript.

I am receiving an error that is not making any sense to me.

Here is the log from PlayStream...

"Logs": [
            {
                "Level": "Error",
                "Message": "PlayFab API request error",
                "Data": {
                    "api": "/Server/UpdatePlayerStatistics",
                    "request": {
                        "PlayFabId": "7355D2DB7E30C0EF",
                        "Statistics": [
                            [
                                {
                                    "StatisticName": "Stars",
                                    "Value": 13,
                                    "Version": 0
                                }
                            ]
                        ]
                    },
                    "result": null,
                    "apiError": {
                        "code": 400,
                        "status": "BadRequest",
                        "error": "InvalidParams",
                        "errorCode": 1000,
                        "errorMessage": "Invalid input parameters",
                        "errorHash": null,
                        "errorDetails": {
                            "StatisticName": [
                                "The StatisticName field is required."
                            ]
                        }
                    }
                }
            } 

        ],

The error says that StatisticName is required, but looking at the data above, The StatisticName is present in the data.

I found a similar question on here that turned out to be a number that couldn't convert to an Int32 causing the problem, but as you can see in the data, it is trying to update to 13, which will convert to Int32 just fine.

Any idea what I might be doing wrong here?

Thanks,

-Larry

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.

Seth Du avatar image Seth Du ♦ commented ·

Can I have your Title ID, Cloud Script revision number and specific function name?

0 Likes 0 ·

1 Answer

·
Larry Dietz avatar image
Larry Dietz answered

The title ID is CFB2 Revision number was 237 and function was UpdateInfo.

However, I just finally figured out my problem, as being an extraneous set of brackets in the function. I removed them in revision 238, and the error has gone away.

Thank you for your help, though.

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.