#Can the API return an actual JSON body? please.

1 messages ยท Page 1 of 1 (latest)

void pivot
#

i'm confused by whoever decided to have the restapi return an html/text
what's the decision behind this? i'm i missing something why can't we just get something proper
even for a single endpoint. i'm just super confused maybe it's just for testing and i'm missing something.

minor heath
#

you're right, but it still doesn't stop you from parsing it to a json object?

void pivot
#

and the api should include a bit more options for params

#

i'm just hoping this is temporary and isn't forever

minor heath
#

@void pivot API is very much the last thing on the mind for the developers. I'm shocked they even decied to open this up as they said they weren't going to support it until after servers went community access.

void pivot
minor heath
void pivot
#

i'm glad that's the case

#

is it possible to close threads?

#

since there's probably no reason for my rant to exist

fast flax
#

i dont understand the issue

#

const response = await fetch(url);
const result = await response.json();

void pivot
#

THAT isn't even my point

#

i don't see a debate here when most sane people have their api return a json body not a text

void pivot
void pivot
#

welp i hope they notice then

#

i'm not sure if they respond to threads at all

#

probably busy people

silk yew
#

Html is a valid restful response, and can be parsed like xml. Check out the HTMX project for some great essays on this topic. Htmx.org

digital jolt
#

Most things just parse it automatically, I didn't even notice it when I made www.battlebit.fun

#

I think the API should return the IP address of the servers, I don't see the purpose of it other than analytical if it can't facilitate third party server browsers?

#
export interface Server {
  Name: string
  Map: string
  MapSize: string
  Gamemode: string
  Region: string
  Players: number
  QueuePlayers: number
  MaxPlayers: number
  Hz: number
  DayNight: string
  IsOfficial: boolean
  HasPassword: boolean
  AntiCheat: string
  Build: string
}
#

Also the API is limited 3req/s

fast flax
#

Nice site. Too bad there isnt any history data for playercount chart in api

void pivot
#

it would probably get added alongside everything else later down the road

fast flax
#

Did you make the site using js?

final bobcat
#

maybe they might give it. if direct connect ever becomes a thing?

void pivot
#

just to grab the ip's

#

by connecting???

final bobcat
#

yeh you can do that

silk yew
#

connecting with the game client and getting the ip is very different from making an api call and pulling the entire list. No need to make shit easier for bad guys.

void pivot
#

if someone was dedicated they definitely

#

would never have an issue grabbing server ips

#

directly from the game memory

#

but yeah i don't see any point of getting the ips unless we get the ability to connect to servers using em

minor heath
#

Itโ€™s an API who really cares for the contents, just be happy we have one.

fast flax
#

thats not how it works pal

void pivot
#

it's a shitty api but i guess we reap what we sow

rustic spruce
#

it's not even a REST api

fast flax
#

๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚ R.I.P Battlebit community 2023 - not even REST api ๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚

fervent rain
rustic spruce
fast flax
#

kk

silk yew
#

Actually a html response can be restful.

rustic spruce
zinc tide
#

love