question

Jeremy Wilkinson avatar image
Jeremy Wilkinson asked

Does Grantuseritems api support a quantity input?

I would like to add a random quantity of a single item in the user inventory, but I have not been able to find a quantity input in the grantuseritem api cloudscript call?

Am I missing this? It seems kind of easy. Also, can you convert Int to String in cloudscript java? Thanks!

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

·
Citrus Yan avatar image
Citrus Yan answered

Hi,

You are talking about GrantItemsToUser API, is that right? If that’s the case, just as the Request Body indicates, you cannot specify the quantity for the item. A possible way to do this would be:

1)Use GrantItemsToUser API to grant an item, get it’s ItemInstanceId from the response.

2)Use ModifyItemUses API to modify uses. (In a general sense, this item should be consumable, usually by count )

Does that make sense?

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.