question

Shaun Peoples avatar image
Shaun Peoples asked

In correct documentation for GrantItemsToUser

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.

Shaun Peoples avatar image Shaun Peoples commented ·

Okay, so now that I've posted the title...here's what's up:

In the documentation for GrantItemsToUser, the returned value for GrantItemsToUserResult should contain an array of GrantedItemInstance. These are stated to contain values for UnitPrice and CustomData, but they don't.

I've stringified the resulting JSON objects and those fields simply don't exist. Since that's the case, I then have to spend another API call to request the user inventory again to simply get these values. Anyway those return values could be fully fleshed out?

Alternatively, maybe I'm missing something along the way, but I don't think so. The documentation is pretty clear, it's just that it seems to be inaccurate.

Thanks,

Shaun

0 Likes 0 ·
Shaun Peoples avatar image Shaun Peoples commented ·

May be worth adding the same type of note (also, maybe in bold or some other color to stand out) that exists in https://docs.microsoft.com/en-us/rest/api/playfab/server/player-item-management/getuserinventory?view=playfab-rest#iteminstance :

A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData.

Also would be good to expand this comment to include all fields that aren't actually returned/populated, such as UnitPrice, which is also the case for ItemInstance returned via GetCatalogItems.

0 Likes 0 ·
Shaun Peoples avatar image Shaun Peoples commented ·

And while we're on it, having to either build a lookup structure or linearly traverse the resulting catalog items seems less than idea when you're having to cross reference and itemid returned from either of the GrantItemsToUser or GetInventory calls. :)

0 Likes 0 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

We have noticed this issue and will have a discussion with our team about expected behavior of GrantItemsToUserResult.

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.

franklinchen avatar image franklinchen commented ·

This issue as some fields' value of GrantedItemInstance is missing in the response of GrantItemsToUser API should have been fixed, please let us know if it still exists

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.