question

xigmasuji avatar image
xigmasuji asked

GrantItemsToUser not working in verison 2 catalog

I am testing GrantItemsToUser in postman the setup is correct and below is the body of api GrantItemsToUser { "PlayFabId": "8DE69C0E4303D10A", "Annotation": "Entered Level 2", "ItemIds": [ "f47131e8-ed78-4a70-98fc-3152c337a127" ] }

it gives the error 1218

"code": 400, "status": "BadRequest", "error": "CatalogNotConfigured", "errorCode": 1218, "errorMessage": "The request must either contain the name of the catalog or the default catalog must be configured on the title."

the item is published on playfab dashboard in item section of catalog v2

apis
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

·
Infer Wang avatar image
Infer Wang answered
2 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.

xigmasuji avatar image xigmasuji commented ·

the add inventory item is not server authoriatative. so not secure. The grantItemsToUser(legacy) require secrect key and can grant any player the item we want. So any alternative for that?

0 Likes 0 ·
Infer Wang avatar image Infer Wang xigmasuji commented ·

You can set Title settings-> Economy(V2)-> policy(V2), to disable the player call AddInventoryItems. And you can call Authentication - Get Entity Token - REST API (PlayFab Authentication) | Microsoft Learn to get title entitytoken and then call AddInventoryItems as title/server authoriatative.(Not only Secret key represents server, title entitytoken also does) 6711-image.png

0 Likes 0 ·
image.png (28.8 KiB)

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.