Web API

Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Public Service Announcement

    Hey Guest, I’ve got some exciting news to share! 🎉

    Starting this December, I’ll be moving the entire GameServersHub website away from WordPress and rebuilding it in Next.js! This upgrade will bring incredibly faster speeds, smoother performance, and a modern user experience that sets the stage for everything coming next.

    In 2026, GameServersHub will be entering a new era. I’ll be revamping the entire platform from the ground up and launching a brand-new, fully modernized marketplace. It’ll feature a cleaner design, improved functionality, and better tools for both creators and server owners.

    On top of that, development has already started on the GameServerListing project at https://gsl-six.vercel.app/, which is expected to launch in early Q1 2026. This new system will make discovering and managing servers easier than ever before.


    👉 Stay in the loop!
    Join our Discord for behind-the-scenes updates, early previews, and community discussions.

    » Click here to join our Discord! «

    ~ MrOwlSky

baylf2000

Well-known member
Joined
Apr 11, 2018
Messages
50
I'm very interested in developing, if possible, some plugins that would utilise some external web apis. For example, I'd like to work on a plugin that calls a web api uri each time any player logs on or logs off a server, with the uri including some kind of player identification.

Is this something the Ark Server API would allow, and if so, might there be any kind of example code I could have a look at?

Thanks so much.
 
That's how you can make a request:
C++:
void RequestCallback(TSharedRef<IHttpRequest> request, bool success)
{
    //
}

void main()
{
    FString url = "url";
    FString verb = "GET";

    const bool result = ArkApi::Requests::Get().CreateRequest(url, verb, &RequestCallback);
}
 
Ok, that seems simple enough. And what would be the simplest way of triggering such code, for example, when any player logs on or off? Are there any of your plugins that do something like this that you might suggest I have a look at?

Many thanks again.
 
I've been able to use the ArkApi::Requests::Get().CreateRequest to set the url, verb, and content. Is there any way to modify the header?

Edit: Forgive me for my newb knowledge of c++ and your api, but from looking at the source of your api, it looks like you have fixed the "Content-Type" header to "text/html"? Am I correct? Or more likely totally wrong.

In order to use the POST method on most REST API's you need to set the "Content-Type" header to "application/json" and then include the data in JSON format in the body of the request.

I'm sure you already know all this and I'm just doing something completely wrong.

Thanks again for your help.
 
Last edited:
You are right, there is no way to edit Content-Type as of now. I will fix it.
For the player login/logout, hook "AShooterGameMode_HandleNewPlayer" and "AShooterGameMode_Logout".
 
OK thank you. In the mean time I can just modify your code slightly and recompile, but obviously I don't want to do that long term.

And thank you for the login/logout hook. That's extremely helpful.

Many thanks.
 
This looks pretty cool/interesting, Hopefully this works out for you.
 
Back
Top