question

stijndevrij avatar image
stijndevrij asked

PlayFabEconomyAPI.SearchItems suddenly returns Invalid request

Our project (Unity/C#) has been in test for a while now, without any problems regarding the PlayFabEconomyAPI.SearchItems API. A few days ago however, we started getting this error:

 Invalid locale, en. Correlation Id: St4tZQhIC0inyF6vn88Khw.0 (InvalidRequest)

We haven't changed anything about the locale id or the way the API gets called. Has anything changed about this call on the API endpoint?

apisIn-Game Economy
4 comments
10 |1200

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

stijndevrij avatar image stijndevrij commented ·

I changed the call to leave the language parameter default and that seems to work for now. I'm still interested in some kind of insight to why the api call suddenly started failing.

0 Likes 0 ·
Xiao Zha avatar image Xiao Zha stijndevrij commented ·

As @kylemc@microsoft.com said in the PlayFabEconomyAPI.GetItemsAsync sudden 400 - InvalidRequest errors - Playfab Community, SearchItems API may be affected by “rolled out FriendlyId support to that API and changed the behavior slightly”.

0 Likes 0 ·
kylemc@microsoft.com avatar image kylemc@microsoft.com Xiao Zha commented ·

This is a different issue than the one with GetItems. A month or two ago, we realized that the SearchItems API was allowing invalid Language values that were silently getting ignored causing the localization feature not to work. We just rolled out an update to the validation logic to start throwing an error for values we don't support. We know this kind of change can be breaking so we spent a long time flighting the change to production titles and looking for issues before a broader rollout.

1 Like 1 ·
Show more comments

1 Answer

·
Xiao Zha avatar image
Xiao Zha answered

If you set the “Language” parameter in SearchItems API to “en”, you may try changing it to “en-GB” to see if the issue persists. In addition, here is the supported locale codes: Economy v2 Localization - PlayFab | Microsoft Learn.

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.