Help with fixing error 403

So I was currently testing the Trades API (https://trades.roblox.com/docs#/) and was testing it out but got stuck in error 403. Here is my code:

import requests

cookie = {
‘.ROBLOSECURITY’: not showing my cookie to dev forum,
}

data = {
“offers”: [
{
“userId”: 1632701684,
“userAssetIds”: [
198335496
],
“robux”: 1000
},
{
“userId”: 1030757071,
“userAssetIds”: [
20573078
],
“robux”: 0
}
]
}

print(requests.post(‘https://trades.roblox.com/v1/trades/send’,data = data,cookies = cookie ))

Response: <Response [403]>
Description of the Error in the API: Token Validation Failed
If you know how to fix it would be really helpful

1 Like

Probably because you typoed your cookie or so

It isn’t, I was testing out with /v1/trades/{trade type}/count which is another request that requires authentication and it was working just fine

Well sorry but i understand NOTHING about HttpService

You’re not the only one. The only thing I know about it is some objects in studio require it.

But I still wonder, do you have HTTPService enabled?

I’m not a good scripter, but I’m pretty sure that you need HTTPService enabled to achieve this.

im not using roblox’s lua, but python in visual studio, the httpsrequests service from roblox is pretty much the same thing as the python requests module. I chose to use python because roblox doenst let you send request into their website unless you use a proxy

eh dats so easy headers should contain X-CRSF-TOKEN

1 Like

I already fixed it, but ty for helping anyway :slight_smile:

1 Like

if you need any help with trade api or other roblox apis send message to me maybe i can help ya.

1 Like