Using python POST requests to upload a decal to roblox

Working on an application right now to be able to upload my UIs through the application I create them on. I have already created the program required to split the layers and export them as PNGs. The problem I have is that when I use python and create a POST request to the Roblox upload API it returns a status code 200 meaning it successfully executed but when I reload my page I don’t see anything uploaded to the site.

Here is the code:

import requests
x = requests.get(r’https://www.roblox.com/develop’)
print(x.status_code)
url = (r’Roblox’)
files = {‘media’: open(r’C:\Users\eshbe\Desktop\RojoProject\Python\Orang.jpg’,‘rb’)}
r = requests.post(url, files=files)
print(r.status_code)

Output:

200
200

So I went researching different sites to get more information on this and I found the Roblox upload API. https://publish.roblox.com/docs#!/Items/post_v1_assets_upload
Here it shows kind of an explanation on how it works for assets but I can’t find one specifically for decals.
I’m pretty stumped with this one… if anyone could help it would be great!

2 Likes

Im pretty sure you can’t manually upload decals. From what I know, you can upload images only. When you do it on the Roblox website, it basically runs some stuff behind the scenes and converts it into a decal after you upload an image.

You need to be logged in. Pass a .ROBLOSECURITY cookie.

1 Like

I will try that. should I just pass it on the post command?

so i can do ?
session = requests.session()
cookies = {‘.ROBLOSECURITY’:''session"}

hello, I’m working on a plugin that allows you to create textures for objects without additional programs, did you manage to upload images to roblox from a script? if so I would appreciate it if you could give me the script