Get all gamepasses that a player created

  1. What do you want to achieve?
    Hello, i want to get all gamepasses that a player created.

  2. What is the issue?
    I can’t manage to do it

  3. What solutions have you tried so far?
    I searched on devforum

2 Likes

There’s no convenient endpoint for what you want here. The only way that you could do this in theory is to get all game passes in a player’s inventory and check if the creator is the player you’re checking but inventory privacy controls defeat this workaround altogether.

Game passes are tied to an experience more than they are the specific developer who created the game pass. You should be looking more to check the game passes available in a specific experience but given that this thread is incredibly vague I don’t know what your use case here is.

1 Like

Well i found this but it dosen’t work for me

1 Like

Its a GET method.

/v2/users/{userId}/inventory/{assetTypeId}

the {userId} is the player’s userid.
the {assetTypeId} is what kind of items you are getting from that player’s inventory.

You can see asset id type from here:

so the url for getting people gamepass is
https://inventory.roproxy.com/v2/users/{userId}/inventory/{assetTypeId}

(setting up your own server ofc, since roblox doesnt allow to use their api stuff in roblox itself, so you have to use thirdparty services.)
when you get the request from your server then
you get the gamepasses, it will return you a json so use HttpService:JSONDecode() to convert it into a a table, then to check who owns the gamepass you can do response.data[1].owner.username to get their username.

The screen shot below is the example of the inventory with the head of Stickmasterluke

The ScreenShot


See it yourself

Note: Make sure their inventory for everyone is on.

(That can be turned on from settings.)

6 Likes

I get error

1 Like

allow Http access on your map and it will work.

1 Like

You can’t access ROBLOX resources, he has already enabled it.

1 Like

You need to use any Proxy like RoProxy I guess… Or research on it and try to work with it.

1 Like

You can’t access Roblox resources, I already tried it some time ago…

1 Like

I forgot to change urls, you have to use a proxy or create your own.

heres the url:
https://inventory.roproxy.com/v2/users/{userId}/inventory/{assetTypeId}
see it working here

1 Like

its working but i need get gamepasses

1 Like

I beleive it would be https://inventory.roproxy.com/v2/users/{userId}/inventory/34 . I could be wrong though. Here is the source that I got it from: AssetType | Roblox Creator Documentation. Someone already posted this in this topic.

1 Like

Here is a module that works and you can use it to get the passes that a player has created:
https://create.roblox.com/marketplace/asset/13705577407

Just call the function ‘GetGamePasses()’ and put the ID of the player you want to get their passes,
and that’s it.

local Module = require(workspace.MainModule) -- yes, the module name is "MainModule"
local PlayerID = 362032269
local PlayerPasses = Module.GetGamePasses(PlayerID)
print(PlayerPasses)

Credits to: @FernandoPelarich

4 Likes

when i try putting 34 as the gamepass asset code it says this {"errors":[{"code":2,"message":"Invalid asset type Id.","userFacingMessage":"Something went wrong"}]} and not working anymore… But it works with the other asset types anyways

2 Likes

Made a post on how to make your own proxy in 10 minutes so if you follow that then the code should be simple:

local PlayersGamepass = {}

local http = game:GetService('HttpService')

local Proxy = "Proxy Name Here".."?link="

local UserId = UserIdHere

local Url1 = "games.roblox.com/v2/users/"..UserId.."/games?accessFilter=2&limit=50&sortOrder=Asc"



local Endcoded = http:UrlEncode(Url1)

local Response = http:GetAsync(Proxy..Encoded)

Response = http:JSONDecode(Response)


if Response.data then
	local Games = Response.data
	
	for i,v in pairs(Games) do
		
		local UniverseId = v.id

		local Url2 = "games.roblox.com/v1/games/"..UniverseId.."/game-passes?limit=100&sortOrder=Asc"
		
		local Encoded2 = http:UrlEncode(Url2)
		local Response = http:GetAsync(Proxy..Encoded2)
		
		Response = http:JSONDecode(Response)
		
		if Response.data then
			for index,gamepass in pairs(Response.data) do
				table.insert(PlayersGamepass,v)
			end
		end
		
		
		task.wait(0.5) --rate limits
	end
end

print(PlayersGamepass)

or if you just want to use roproxy then:

local PlayersGamepass = {}

local http = game:GetService('HttpService')


local UserId = 2786156208

local Url1 = "https://games.roproxy.com/v2/users/"..UserId.."/games?accessFilter=2&limit=50&sortOrder=Asc"


local Response = http:GetAsync(Url1)

Response = http:JSONDecode(Response)


if Response.data then
	local Games = Response.data
	
	for i,v in pairs(Games) do
		
		local UniverseId = v.id

		local Url2 = "https://games.roproxy.com/v1/games/"..UniverseId.."/game-passes?limit=100&sortOrder=Asc"
		
		local Response = http:GetAsync(Url2)
		
		Response = http:JSONDecode(Response)
		
		if Response.data then
			for index,gamepass in pairs(Response.data) do
				table.insert(PlayersGamepass,v)
			end
		end
		
		
		task.wait(0.5) --rate limits
	end
end

print(PlayersGamepass)
3 Likes

is there any way i could get a image off the asset, like image off the gamepass, or shirt?

local mps = game:GetService("MarketPlaceService")
mps:GetProductInfo(GAMEPASS/SHIRT ANY THING_ID)

I written it in the developer forum code editor so don’t mad at me if it not does not work