Dr_Luxxe
(Luxxe)
April 19, 2021, 3:30pm
#1
Goal: I want to make a bot that promotes users in a group based on how many shirts/pants they bought
Issue: I don’t know what API to use to check if a shirt/pants is owned by a group.
What I’ve tried: I’ve looked on the Developer Hub, Api Docs, and can’t find anything, I could just be blind
What I already have: I have discovered this API where you can find all of the shirts owned by the user. I can make the bot scan through every one to count how many are owned by a group, though. https://inventory.roblox.com/v1/users/96185281/inventory/Shirt?itemsPerPage=999999999
What I need: I need the API for checking if a specific shirt/pants ID is owned by a group
Thanks for the help!
EDIT:
This has to be external API that returns JSON
Use this method and check if the Creator.CreatorType
is equivalent to a group.
Dr_Luxxe
(Luxxe)
April 19, 2021, 3:33pm
#3
This needs to be an external API, I forgot to mention that. It would have to be something that returns JSON.
You could use this:
http://api.roblox.com/docs#Marketplace
(/marketplace/productinfo)
and check the ProductType
.
I believe this is what MarketplaceService uses.
Alternatively, you could use: Catalog Api
(Though I’m not sure if this helps your use case)
1 Like
local item = 000000 -- id of the item
local MPS = game:GetService('MarketplaceService')
local Info = MPS:GetProductInfo(item)
if Info.CreatorType == 'Group' then
print('Is owned by group')
end
Full API for GetProductInfo():
https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/GetProductInfo
Dr_Luxxe
(Luxxe)
April 19, 2021, 3:56pm
#6
Thanks for the help! It worked!
I think you could use:
GET /assets/{id}/versions
to get a JSON table like this:
[
{
"Id": 536133191,
"AssetId": 226132918,
"VersionNumber": 3,
"RawContentId": 2619739106,
"ParentAssetVersionId": 536132109,
"CreatorType": 1,
"CreatorTargetId": 80502178,
"CreatingUniverseId": null,
"Created": "2015-07-13T11:51:12.9073098-05:00",
"Updated": "2015-07-13T11:51:12.9073098-05:00"
}
]
I believe you can then you can use the “CreatorType” and the “CreatorTargetId” properties to check if the asset was created by your group.
3 Likes