Game Jolt PHP API
Version 0.9 - 5th January 2010
Download Link(s)
Version 0.9 Github: https://github.com/ashleygwinnell/Game-Jolt-PHP-Game-API
Example Usage
$game_id = 1;
$private_key = "";
$trophy_id = "";
$username = "";
$usertoken = "";
$gj = new GameJoltTrophyAPI($game_id, $private_key);
if ($gj->verifyUser($username, $token) == true)
{
echo "<h2>Authenticated successfully!</h2>";
print_r($gj->getTrophies("EMPTY"));
print_r($gj->getTrophy($trophy_id));
} else {
echo "<h2>" . $result . ": Could not authenticate you. :(!</h2>";
}
Example Usage Explanation
You need to fill in the variables in the above Java program with the relevant information. Most of the information can be found in the "Manage Trophies" section when you're editting your game.
You may not use any of the data-calling methods before calling verifyUser(). You should only need to call verifyUser once for each GameJoltTrophyAPI object.
Since this is just a port of the Java API, everything should be nice and high level and easy to use. There are a few differences from the Java version.
Differences
- A method has been added named "setUsingCURL()" incase your PHP server does not allow you to get information from a url using the normal file methods.
- The class/object name is GameJoltTrophyAPI and not GameJoltAPI.
- Enum types "Difficulty" and "Achieved" are replaced with Strings.
- There is "request()" and "requestFromArray()" since overloading is not supported.
Now you may be thinking:
What point is there to this library?
Isn't PHP a server-side scripting language?
What /game/ is going to use PHP?
Well, probably very few. There may be a few turn based browser game's out there that want to use GameJolt Achievements, but I still think that's unlikely.
I'm using this library with Netbin. Here's how it is:
- Netbin will offer an API directly mapping to the GameJolt Trophy API.
- You pass Netbin your trophy requests and Netbin will pass it on to Game Jolt.
- Netbin will store the data too and will show it on the site!
Wahey, your favourite game site mixed with some social networking.
If you run into any troubles, as far as I am aware, you may ask in this thread. :)
Additional Links
GJ API Documentation
Netbin
Last edited on July 30, 2012 - 06:11 PM by Ashley

