Hi, is there something wrong with the following request?
server.GrantItemsToUsers({ ItemGrants: [{ PlayFabId: currentPlayerId, ItemId: lootBoxEarnedItemId, Data: referenceItem.CustomData }] });
It produces the following error on playfab:
{ "Level": "Error", "Message": "PlayFab API request error", "Data": { "api": "/Server/GrantItemsToUsers", "request": { "ItemGrants": [ { "PlayFabId": "XXXXX", "ItemId": "lootbox.6", "Data": "{\"droptable\":\"Loot Box 6\",\"type\":\"6\"}" } ] }, "result": null, "apiError": { "code": 400, "status": "BadRequest", "error": "InvalidParams", "errorCode": 1000, "errorMessage": "Invalid input parameters", "errorHash": null, "errorDetails": { "PlayFabId": [ "The PlayFabId field is required." ], "ItemId": [ "The ItemId field is required." ] } } } }
If I modify the request to include the keys it says it's missing, I get more errors:
{ "Level": "Error", "Message": "PlayFab API request error", "Data": { "api": "/Server/GrantItemsToUsers", "request": { "PlayFabId": "XXXXX", "ItemId": "lootbox.6", "Data": "{\"droptable\":\"Loot Box 6\",\"type\":\"6\"}", "ItemGrants": [ { "PlayFabId": "XXXXX", "ItemId": "lootbox.6", "Data": "{\"droptable\":\"Loot Box 6\",\"type\":\"6\"}" } ] }, "result": null, "apiError": { "code": 400, "status": "BadRequest", "error": "InvalidParams", "errorCode": 1000, "errorMessage": "Invalid input parameters", "errorHash": null, "errorDetails": { "ItemGrants[0].Data": [ "" ] } } } }