API Key: Difference between revisions

From Zoo Wiki
→‎Effects: rewrote & made it prettier
Line 53: Line 53:
The player's profile on the [[Zoo API]] gains a <code>secretInfo</code> field with the following data:
The player's profile on the [[Zoo API]] gains a <code>secretInfo</code> field with the following data:


{| class="sortable wikitable mw-collapsible mw-collapsed"
{| class="wikitable sortable"
|+ secretInfo
|+
! Property Name
!Key
! Information
!Explanation
!Data type
|-
|-
| sort
|rowspan=2|<code>sort</code>
| Shows the sorting method in /animals. 0 being Name and 1 being Amount.
|rowspan=2|How the player's animals is sorted
|<code>0</code>: Sorted by name
|-
|-
| color
|<code>1</code>: Sorted by amount
| Shows the color of the zoo in a decimal number.
|-
|-
| promise
|<code>color</code>
| Shows what is promised on the next rescue. There can be multiple kinds of promises
|Zoo color
{| class="wikitable"
|Decimal number representing a [[w:hex triplet|hex triplet]]
! Promise
! Information
|-
|-
| type
|<code>promise</code>
| Promises a specific type of animal on the next rescue.
|Things guaranteed for the next rescue
|
{| class="wikitable sortable mw-collapsible"
|+
!Key
!Explanation
!Data type
|-
|-
| pair
|<code>pair</code>
| Promises a pair on the next rescue.
|Whether a pair is guaranteed
|Boolean
|-
|-
| animal
|rowspan=8|<code>type</code>
| Promises a specific animal on the next rescue.
|rowspan=8|The guaranteed [[animal type]]
|<code>arctic</code>: Arctic animal
|-
|<code>bird</code>: Bird
|-
|<code>bug</code>: Bug
|-
|<code>farm</code>: Farm animal
|-
|<code>favorite</code>: Leader's favorite animal
|-
|<code>jungle</code>: Jungle animal
|-
|<code>pet</code>: Pet
|-
|<code>water</code>: Aquatic animal
|-
|<code>animal</code>
|The guaranteed animal
|Internal name of the animal (equivalent to the shortcode of its emoji)
|-
|<code>debuffImmunity</code>
|Cooldown raises will be divided by this number
|Integer
|-
|<code>buffBoost</code>
|Cooldown reductions will be multiplied by this number
|Integer
|-
|<code>luckyRelics
|Whether the best outcome is guaranteed for luck-based effects
|Boolean
|}
|}
|-
|-
| questEnd
|<code>questEnd</code>
| Shows the exact unix timestamp of when the quest ends.
|When the current [[quest]] ends
|[[w:Unix timestamp|Unix timestamp]]
|-
|-
| questBoosts
|<code>curseEnd</code>
| Shows all boosts applied to the next quest.
|When the player's [[curse]] ends
|Unix timestamp
|-
|-
| curseEnd
|<code>mechanicEnd</code>
| Shows the exact unix timestamp of when the curse ends.
|When the current [[mechanic]] upgrade finishes
|Unix timestamp
|-
|-
| mechanicEnd
|<code>questBoosts</code>
| Shows the exact unix timestamp of when the mechanic finishes.
|Things guaranteed for the current quest
|
{| class="wikitable sortable mw-collapsible"
|+
!Key
!Explanation
!Data type
|-
|-
| shop
|<code>rareCurse</code>
| Shows multiple statistics about the shop
|Whether [[Safety Pin]] was used
{| class="wikitable"
|Boolean
! Property Name
! Information
|-
|-
| credits
|<code>extraRewards</code>
| The amount of shop purchases remaining.
|Number of extra rewards guaranteed by [[Telescope]]
|Integer
|-
|-
| nextCredit
|<code>length</code>
| Shows the exact unix timestamp of when you get another credit.
|Length increase
|Number of hours
|}
|-
|-
| maxCredits
|<code>shop</code>
| Shows the maximum amount of shop purchases that you can get at maximum.
|Shop info
|
{| class="wikitable sortable mw-collapsible
|+
!Key
!Explanation
!Data type
|-
|-
| lastPurchase
|<code>credits</code>
| Shows the exact unix timestamp of your last purchase in the shop.
|Shop credits
|Integer
|-
|rowspan=2|<code>maxCredits</code>
|rowspan=2|Maximum credits
|<code>6</code> if [[Sack]] is equipped
|-
|<code>4</code> otherwise
|-
|<code>nextCredit</code>
|When the next credit will be given
|Unix timestamp
|-
|<code>lastPurchase
|Time of last purchase
|Unix timestamp
|}
|}
|-
|-
| cooldowns
|<code>cooldowns</code>
| Shows the unix timestamp of when all of your current cooldowns expire.
|Most time-based cooldowns
{| class="wikitable"
|
! Cooldowns
{| class="wikitable sortable mw-collapsible"
! Information
|+
!Key
!Explanation
!Data type
|-
|<code>rescue</code>
|Rescue cooldown
|rowspan=7|Unix timestamp
|-
|-
| rescue
|<code>relic</code>
| The exact unix timestamp of when you can rescue.
|Relic cooldown
|-
|-
| relic
|<code>leader</code>
| The exact unix timestamp of when you can switch relics.
|Leader cooldown
|-
|-
| leader
|<code>cardPull</code>
| The exact unix timestamp of when you can switch leaders.
|{{cmd|pull}} cooldown
|-
|-
| profile
|<code>pet</code>
| The exact unix timestamp of when you can switch or create profiles.
|{{cmd|pet}} cooldown
|-
|-
| cardPull
|<code>fishy</code>
| The exact unix timestamp of when you can pull a card.
|{{cmd|fishy}} cooldown
|-
|-
| pet
|<code>sisyphus</code>
| The exact unix timestamp of when you can pet roboturt.
|{{cmd|sisyphus}} cooldown
|-
|-
| fishy
|rowspan=2|<code>profile</code>
| The exact unix timestamp of when you can fish with the $ fishy command.
|rowspan=2|Profile cooldown
|<code>null</code> if player only has one profile
|-
|-
| sisyphus
|Unix timestamp otherwise
| The exact unix timestamp of when you can roll a boulder with the $ sisyphus command.
|}
|}
|-
|-
| terminal
|<code>terminal</code>
| Shows different information about the terminal.
|[[Terminal]] data
{| class="wikitable"
|
! Property Name
{| class="wikitable sortable mw-collapsible"
! Information
|+
!Key
!Explanation
!Data type
|-
|-
| directory
|<code>directory</code>
| Shows the current directory of the user.
|Current directory
|String
|-
|-
| commands
|<code>commands</code>
| Shows every command that the user has discovered. The current discoverable commands are "adminunlock", "dirwarp", "nick", "repaircmd", "give", "inventory", "pull", "show", "fuse", "fusions", "nfbs", "tokenshop", "unfuse", "wanted", "countxp", "button", "cowsay", "egg", "node", "pet", "pray", "sisyphus", "testconnection", "vim", "yes", "8ball", "dunsparce", "penguin", "percent", "ping", "random", "complete", "defer", "fishy", "fullzoo", "garden", "loop", "murphypoints", "nomnomnom", "pride", "todo", "zoo", "cd", "echo",  "help", "ls", "neofetch"
|Commands listed in {{cmd|help}}
|Array
|-
|-
| nextFusion
|<code>nextFusion</code>
| Shows how many rescues remain until you can fuse again.
|{{cmd|fuse}} cooldown
|Number of rescues until {{cmd|fuse}} can be used (<code>0</code> if no cooldown)
|}
|}
|-
|-
| garden
|<code>garden</code>
| Shows different information about the garden.
|[[Garden]] data
{| class="wikitable"
|
! Property Name
{| class="wikitable sortable mw-collapsible"
! Information
|+
!Key
!Explanation
!Data type
|-
|-
| nextPlant
|<code>nextPlant</code>
| Shows the exact unix timestamp until you can plant again.
|When the next seedling can be planted
|Unix timestamp
|-
|-
| watered
|rowspan=2|<code>watered</code>
| If the user has already watered a plant in their garden. true being that they have watered.
|rowspan=2|Whether the garden was watered
|<code>false</code>: A plant can be watered
|-
|-
| longestPlant
|<code>true</code>: Cannot water until rescuing again
| How long have you kept a plant alive for.
|-
|-
| sprinkler
|<code>longestPlant</code>
| What slot does the user have the sprinkler on.
|Longest lasting plant
|}
|Milliseconds
|}
|}



Revision as of 15:09, 7 April 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 is sorted 0: Sorted by name
1: Sorted by amount
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 Things guaranteed 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

API Key was added in RoboTop version 93.22, released on February 2, 2022.

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