Roblox group APIs

Hi! I am using group APIs v1. What I want to do is to create a script in js that will allow me to withdraw Robux from my group to some users. I created(shown in the image below.)

I already created code just problem is that I don’t know how to authorization be valid. I don’t know even where to put it. I would really appreciate your help.

3 Likes

That type of requests need authentication so you need to pass in the headers of the request the .ROBLOSECURITY cookie of the account you are using to give robux.

{
    'Cookie': '.ROBLOSECURITY=cookie goes here'
}
2 Likes

LOL, you are fast. I will try it now and will see. Thx.

2 Likes

Nope. I still get same message.

Authorization has been denied for this request.

1 Like

Can you send the code you are using?

Yes. It’s not standard because I am programming Disord bot.

 await lib.http.request['@1.1.6'].post({
     url: `https://groups.roblox.com/v1/groups/12851676/payouts`,
     params: {
       groupId: `12851676`,
       request: `{\n  \`PayoutType\': \"FixedAmount\",\n  \"Recipients\': [\n    {\n      \'recipientId\': ${UserID},\n      \'recipientType\': \'User\",\n      \"amount\': ${Amount}\n    }\n  ]\n}`,
       Cookie: `${process.env.ROBLOX_SECURITY_KEY}`,
     }
   });

That’s not how you send the headers. They should be sent like this:

headers: {
    'Cookie': '.ROBLOSECURITY=cookie' 
}
1 Like

For some reason still nothing.

Well I don’t know how the library you are using works but that is how headers are sent you should try to read the documentation to understand how it works and how to send headers. I suggest using axios which is also easier.

I may follow up with an update on this later

1 Like

If help I use this:
https://autocode.com/lib/http/request/#get

Test = cookie
123 = cookie think

Headers are sent as json. You need to change “Test” with “Cookie” and “123” with “.ROBLOSECURITY=your roblosecurity cookie”

1 Like

Tried now. Isn’t working. Still the same error.

Could you confirm the error message you’re getting? Is it still the same error?

1 Like

I always got this error.

{
  errors: [
    {
      code: 0,
      message: 'Authorization has been denied for this request.'
    }
  ]
}

send your new code so we can see how you are doing it. i would also suggest to test this with the code runner that is provided in the documentation you sent

1 Like

look up a tutorial on how to do that.

I have no experience with the currently library and usually just use noblox or something along those lines for all Roblox stuff, it makes stuff like this pretty much foolproof and pretty impossible to mess up on. I’ll try giving it a go in a bit and probably have a solution for you when I get the time to if you’re still experiencing this.

Just a quick question though, have you considered using noblox for this? They have something for group payouts. If so, is there a reason you’ve decided not to use noblox? I could provide some sample code using noblox if you wanted or another library I’m familiar with.

There is no tutorial for it. At least I didn’t found it.