So I have been trying to use the thumbnail uploader api (Publish Api), however I haven’t had success in either the api page itself or in my own code.
my current code is :
gameid = "my game id is here :/"
url = ''.join(['https://publish.roblox.com/v1/games/',gameid,'/thumbnail/image'])
session.post(url, files = {
'icon': ('thumbnail.png', open('thumbnail.png', 'rb'), 'image/png')
}
)
This code returns me the following error:
{
"errors": [
{
"code": 4,
"message": "Target item is invalid or does not exist.",
"userFacingMessage": "Something went wrong"
}
]
}
I have both my robloxscurity and xcsrf token in my headers so this isn’t a verification error.
The api gives an additional parameter for use as well, however I couldn’t figure what it was supposed to be based on the documentation.
{
"targetId": 0
}
Any help solving this problem would be appreciated
I am not sure if you are trying to post a THUMBNAIL or the ICON (two different things), but I don’t know if this API supports icons or not. The icon is the picture on the front page of the game (only one can be applied) and the thumbnail(s) are the rectangle ones on the game’s page.
btw I tried using your code, it gave an error in the library itself, not the endpoint, meaning it is not the correct syntax for posting files in requests
gameid = "123"
url = ''.join(['https://publish.roblox.com/v1/games/',gameid,'/thumbnail/image'])
files = {
'thumbnail': ('thumbnail.png', open('thumbnail.png', 'rb'), 'image/png')
}
session.post(url, files=files.thumbnail) -- i dont know if thats the correct way to index
Hi there. I actually figured out it has nothing to do with the file… so let’s revert to the ORIGINAL code.
The actual issue is the ID you are using. It is NOT the one that shows up in the URL. It is the UNIVERSE ID, which can be found when configuring the experience (not the place).
Apologies for my original confusion, I have no experience with Python. Let me know if this helps with anything!