LookupAPIKey (open)
Obtain an API key
Syntax
LOADLIB "mod::system/lib/keystore.whlib";
RECORD FUNCTION LookupAPIKey(STRING type, STRING requestdomain, RECORD options)
Parameters
STRING type
Key type you're looking up. Must be "google" or "google-recaptcha" at this moment
STRING requestdomain
Domain or URL for which you're requesting a key
RECORD options
Options
allowmissing
If true, returns a default record if not found. Otherwise, the function will throw
scope
Target use for the key. client
for an apikey you can send to the user (eg javascript),
server
for an apikey to use when directly communicating to the api. 'any' if you don't care
Return value
RECORD
The api keys, or throws if no match is found (unless allowmissing is set)
apikey
The API key
privatekey
The private key, if set