API Key: Difference between revisions

From Zoo Wiki
→‎History: 1.3.1: now displays more info
Line 275: Line 275:
!colspan=2|Zoo Bot
!colspan=2|Zoo Bot
|-
|-
|v1.0.1
|Now displays cooldowns for {{cmd|pull}} and {{cmd|pet}}.<ref>{{cite changelog|1.0.1|Added card and pet cooldowns to the API, if you have the right permissions}}</ref>
|-
|-
|v1.3.1
|v1.3.1
|API Key now displays more info.<ref>{{cite changelog|1.3.1|Added more terminal related info to API Key}}</ref>
|Now displays more info.<ref>{{cite changelog|1.3.1|Added more terminal related info to API Key}}</ref>
|-
|-
|v1.4.5
|v1.4.5
|API Key now requires 3 other relics to unlock instead of just 1.<ref>{{cite changelog|1.4.5|Tweaked a certain secret relic to require having 3 relics first (previously 1)}}</ref>
|Now requires 3 other relics to unlock instead of just 1.<ref>{{cite changelog|1.4.5|Tweaked a certain secret relic to require having 3 relics first (previously 1)}}</ref>
|}
|}



Revision as of 01:06, 13 May 2024

API Key
“Nerd.”

API Key is a unique relic unlocked by sending a POST request to a "secret" endpoint.

Obtaining

The player must have at least three other relics in order to obtain API Key.

API Key is obtained by sending a POST request to the following endpoint: https://gdcolon.com/zoo/api/zooKey. This can be done using a desktop browser's developer tools. The request body must contain a JSON object, with the player's Discord ID in a id parameter. The player must also provide their session token, either as a cookie or as a Token header.

The server responds with an error, asking for a piece of trivia (e.g. your favorite color) in the response body. The specific trivia asked is different for each player. When resending the request with the trivia, API Key is granted.

Below is Python code to send the request:

import requests
url = "https://gdcolon.com/zoo/api/zooKey" #endpoint
headers = {"Content-Type": "application/json", "Accept": "application/json", "Token": ""} #request headers, insert authentication token into the Token header

#id refers to your Discord User ID
#password can be a few things (usually it's your public IP address/last 3 digits of your token). Leave blank at first and see the response to know which password it wants
params = {"id": "", "password": ""}
 
response = requests.post(url, headers=headers, json=params)
print(response.status_code)
print(response.text)

The authentication token is obtained by

1. Logging into gdcolon.com/zoo

2. Going into the Application tab in the Developer Tools

3. Finding https://gdcolon.com under 'Cookies', which is located in 'Storage'.

4. Find the Cookie Value for 'zoo', which is the authentication token.

Here's a website that allows you to run python code. https://reqbin.com/code/python

Troubleshooting

If you encounter an error while running the code via the aforementioned website, follow these steps:

  1. Install Python
  2. Save your code in a Python (.py) file, you can use Python itself, Notepad, Visual Studio, anything you want. Save it in your user folder under an easy name (e.g. zoo.py)
  3. Open CMD (Win+R -> cmd), If you are on MacOS open Terminal from the Launchpad. If you are on Linux you know how to open the terminal already...
  4. Run the following command: python [name of the file with the code you saved]
  5. If you did everything correctly, you should now have the API Key relic!

If python says the "requests" library is not installed, run this command in your terminal:

python -m pip install requests

Effects

Reveals cooldown, timestamps, and other hidden info on the online zoo API.

— In-game description

The player's profile on the Zoo API gains a secretInfo field with the following data:

Key Explanation Data type
sort How the player's animals are sorted 0: Sorted by amount
1: Sorted by name
color Zoo color Decimal number representing a hex triplet
promise Things guaranteed for the next rescue
Key Explanation Data type
pair Whether a pair is guaranteed Boolean
type The guaranteed animal type arctic: Arctic animal
bird: Bird
bug: Bug
farm: Farm animal
favorite: Leader's favorite animal
jungle: Jungle animal
pet: Pet
water: Aquatic animal
animal The guaranteed animal Internal name of the animal (equivalent to the shortcode of its emoji)
debuffImmunity Cooldown raises will be divided by this number Integer
buffBoost Cooldown reductions will be multiplied by this number Integer
luckyRelics Whether the best outcome is guaranteed for luck-based effects Boolean
questEnd When the current quest ends Unix timestamp
curseEnd When the player's curse ends Unix timestamp
mechanicEnd When the current mechanic upgrade finishes Unix timestamp
questBoosts Bonuses for the current quest
Key Explanation Data type
rareCurse Whether Safety Pin was used Boolean
extraRewards Number of extra rewards guaranteed by Telescope Integer
length Length increase Number of hours
shop Shop info
Key Explanation Data type
credits Shop credits Integer
maxCredits Maximum credits 6 if Sack is equipped
4 otherwise
nextCredit When the next credit will be given Unix timestamp
lastPurchase Time of last purchase Unix timestamp
cooldowns Most time-based cooldowns
Key Explanation Data type
rescue Rescue cooldown Unix timestamp
relic Relic cooldown
leader Leader cooldown
cardPull $ pull cooldown
pet $ pet cooldown
fishy $ fishy cooldown
sisyphus $ sisyphus cooldown
profile Profile cooldown null if player only has one profile
Unix timestamp otherwise
terminal Terminal data
Key Explanation Data type
directory Current directory String
commands Commands listed in $ help Array
nextFusion $ fuse cooldown Number of rescues until $ fuse can be used (0 if no cooldown)
garden Garden data
Key Explanation Data type
nextPlant When the next seedling can be planted Unix timestamp
watered Whether the garden was watered false: A plant can be watered
true: Cannot water until rescuing again
longestPlant Longest lasting plant Milliseconds

History

RoboTop
v93.22 Added API Key.[1]
Zoo Bot
v1.0.1 Now displays cooldowns for $ pull and $ pet.[2]
v1.3.1 Now displays more info.[3]
v1.4.5 Now requires 3 other relics to unlock instead of just 1.[4]

API Key was the first relic to have a unique unlock method other than through quests.

References

  1. RoboTop changelog, v93.22 (released 2 February 2022):

    “added a secret new relic, may or may not be hidden in the console of the zoo site”

  2. Zoo changelog, v1.0.1 (released 18 February 2023):

    “Added card and pet cooldowns to the API, if you have the right permissions”

  3. Zoo changelog, v1.3.1 (released 11 June 2023):

    “Added more terminal related info to API Key”

  4. Zoo changelog, v1.4.5 (released 8 September 2023):

    “Tweaked a certain secret relic to require having 3 relics first (previously 1)”