Try this in apps script
key needs to be your bearer token
url needs to be the api-path you want to call. E.g.: 'account/wallet'
this will return a json-object, but gs or basically js can deal very well with it
deleted some lines which are not interested for you and didnt validated the syntax, so maybe there is some missing semicolon or bracket
cheers