Send a [GET]
request to this url https://groups.roblox.com/v1/groups/{groupId}
You have to make your server, I recommend you to use Heroku to host your website.
I know node.js so ill give you an example fetching group info using node js.
How to create a simple server with node js using express? - Youtube
perfect you’ve created a server!
Now install node-fetch
using npm install node-fetch
When its installed, require it in your app.
const fetch = require('node-fetch')
Now to get the group info do
const response = await fetch(`https://groups.roblox.com/v1/groups/${groupId}`,{method: 'GET'});
Good! you now got the group info you needed! but… how did we get the group id that i’ve mentioned in url?
Don’t worry! keep reading.
Now lets join up our whole javascript code.
const express = require('express');
const fetch = require('node-fetch');
const app = express()
app.get('/groupInfo/:id', async (req,res) => {
if (req.params) {
if (req.params.id) {
var groupId = req.params.id
const response = await fetch(`https://groups.roblox.com/v1/groups/${groupId}`,{method: 'GET'});
if (!response) { res.send('No response') return }
res.json(response)
}
}
})
app.listen(3000, () => {
console.log("Server is started at port 3000.")
});
perfect! now host your app on heroku
How to host your node js application on heroku - Youtube
Now get your website url appname.herokuapp.com
Now use HttpService to get the group info.
local httpservice = game:GetService("HttpService")
Now get the response using httpservice:GetAsync()
local res = httpservice:GetAsync("appname.herokuapp.com/groupid")
Now you will get the response in JSON
to convert JSON
into a table you have to use HttpService:JSONDecode()
perfect now you got the group info! we are almost done.
To check if group is locked or not you have to do
res.publicEntryAllowed
if its true
then its mean group is not locked, if its false then its locked.
if res.publicEntryAllowed then
print("Group is not locked")
else
print("Group is locked")
end
Now joining the code together!
local httpservice = game:GetService("HttpService")
local groupId = "0000000"
local website_url = "appname.herokuapp.com"
local response
local success,errorr = pcall(function()
response = httpservice:GetAsync(website_url.."/"..groupId)
end)
if success then
if response == "No response" then
return error("Got no response, maybe group id is invaild?")
end
local info = httpservice:JSONDecode(response)
if info.publicEntryAllowed then
print('Group is not locked')
else
print('Group is locked.')
end
else
error(errorr)
end
Replace groupId
with your group id
Replace website_url
with your heroku app url.
Hope this helps!