Game Jolt API
This extension allows you to easily implement the Game Jolt API using a public domain library.
Blocks
Blocks that the extension uses to send requests to the Game Jolt API.
Checks to see if the URL is the Game Jolt website.
Session Blocks
Operating on the game's session.
This block is required for all requests to work.
Opens/closes a game session.
- You must ping the session to keep it open and you must close it when you're done with it.
When you login the session is opened automatically.
Pings an open session.
- If the session hasn't been pinged within 120 seconds, the system will close the session and you will have to open another one.
- It's recommended that you ping about every 30 seconds or so to keep the system from clearing out your session.
When the session is opened it is pinged every 30 seconds automatically.
- You can ping it manually to update the session status.
Sets the session status to active/idle.
- Ping the session to update it's status.
Checks to see if there is an open session for the user.
- Can be used to see if a particular user account is active in the game.
User Blocks
Login, logout and fetch users.
This block is required for all user based requests to work.
Requires to not be logged in.
- When logged in on the Game Jolt website and the game is played on Game Jolt, the user is logged in automatically.
Does automatic login after logout.
Requires to not be logged in.
- Requires to be logged in on the Game Jolt website and for the game to be played on Game Jolt.
Checks to see if the user is logged in on the Game Jolt website and the game is played on Game Jolt.
Logs out the user, the game session is then closed.
Requires to be logged in.
Checks to see if the user is logged in.
Returns the logged in user's username.
Requires to be logged in.
Fetches user data based on the user's username or the ID
Fetches logged in user data.
Requires to be logged in.
Returns fetched user's data by passed key.
Returns fetched user's data in JSON.
Fetches user's friend IDs.
Requires to be logged in.
Returns fetched user's friend ID at passed index.
Returns fetched user's friend IDs in JSON.
Trophy Blocks
Achieve, remove and fetch trophies.
Achieves trophy of passed ID.
Requires to be logged in and for the trophy to not be achieved.
Removes trophy of passed ID.
Requires to be logged in and for the trophy to be achieved.
Fetches trophy of passed ID.
Requires to be logged in.
Fetches game trophies:
- All - fetches all trophies.
- All achieved - fetches all achieved trophies.
- All unachieved - fetches all unachieved trophies.
Requires to be logged in.
Returns fetched trophy data at passed index by passed key.
Returns fetched trophy data in JSON
Score Blocks
Adds a score in table of an ID with a text and an optional comment.
- Score, table ID, text and optional comment are passed.
Requires to be logged in.
Adds a score in table of an ID with text and optional comment for the a guest.
- Score, table ID, text, optional comment and guest's username are passed.
Fetches global/user scores in table of an ID.
- Limit, global/user option and table ID are passed.
Requires to be logged in.
Fetches global/user scores better/worse than a value in table of an ID.
- Limit, global/user option, better/worse option, a value and table ID are passed.
Requires to be logged in.
Fetches guest's scores in table of an ID.
- Limit, guest's username and table ID are passed.
Fetched quest's scores better/worse than a value in table of an ID.
- Limit, guest's username, better/worse option, a value and a table ID are passed.
Returns fetched score data at passed index by passed key.
Returns fetched score data in JSON.
Fetches and returns a rank of passed value in table of passed ID.
Fetches score tables.
Returns fetched table data at passed index by passed key.
Returns fetched tables in JSON.
Data Storage Blocks
Operate on Game Jolt's cloud variables.
Sets global/user data at passed key to passed data.
User option requires to be logged in.
Fetches and returns global/user data at passed key.
User option requires to be logged in.
Updates global/user data at key by operation with value.
- Global/user option, key, operation and value are passed.
User option requires to be logged in.
Removes global/user data at passed key.
User option requires to be logged in.
Fetches all global/user keys.
User option requires to be logged in.
Fetches global/user keys matching with passed pattern.
- Examples:
- A pattern of
*
matches all keys. - A pattern of
key*
matches all keys withkey
at the start. - A pattern of
*key
matches all keys withkey
at the end. - A pattern of
*key*
matches all keys containingkey
.
- A pattern of
User option requires to be logged in.
Returns fetched key at passed index.
Returns fetched keys in JSON.
Time Blocks
Track server's time.
Fetches server's time.
Returns fetched server's time data by passed key.
Returns fetched server's time data in JSON.
Batch Blocks
Fetch more data per request.
Adds passed arguments to the batch.
- The batch is an array of sub requests consisting of the namespace and the parameters object.
Clears the batch of all sub requests.
Returns the batch in JSON.
Fetches the batch.
- After the fetch the batch is not cleared.
You can call the batch request in different ways:
- Sequentially - all sub requests are processed in sequence.
- Sequentially, break on error - all sub requests are processed in sequence, if an error in one of them occurs, the whole request will fail.
- In parallel - all sub requests are processed in parallel, this is the fastest way but the results may vary depending on which request finished first.
User based sub requests require to be logged in.
Returns fetched batch data in JSON.
Debug Blocks
Blocks used for debugging.
Turns debug mode on/off.
- When debug mode is off, instead of errors, reporters return an empty string and booleans return false.
Checks to see if debug mode is on.
Returns the last API error.
Handling Common Errors
Handling commonly encountered errors.
This error occurs when the game ID you set is invalid.
Handling
This error can be avoided by using this block:
- Make sure the value matches your game's ID.
This error occurs when the private key you set is invalid.
Handling
This error can be avoided by using this block:
- Make sure the value matches your game's private key.
This error occurs when no user is logged in.
- The most common cause is that the extension failed to recognize the user.
Handling
This error can be avoided with a manual login option.
This error occurs when manual login failed to recognize the user credentials you passed in.
- It can also occur with autologin when no user is recognized by the extension.
Handling
This error can be avoided by modifying the previous example to try again after a failed login attempt.
These errors occur when you are trying to access non-existent data.
- Make sure you have previously fetched the data you are trying to access.
- Make sure you have the right index as indexing starts at 0 instead of 1.