I have been having a strange error that I have been going in circles trying to figure out. I decided to learn some JavaScript/google apps script to parse some information from an api of a game I play. I followed a bunch of tutorials and searched google and Stack Overflow for solutions but none have worked. I think I've narrowed it down to one particular Method: the "UrlFetchApp."
Right now I'm simply trying to grab some JSON data from the API and display it in the log window.
I keep getting this:
[21-09-13 09:01:40:770 EDT] Exception: Request failed for https://api.guildwars2.com returned code 429. Truncated server response: {"text":"too many requests"} (use muteHttpExceptions option to examine full response)
at getRequest(Untitled:4:30)
Now here's the strange part, I ran the script from my phone at work to test some theories out and got this:
[21-09-13 09:02:20:943 EDT] {
"name": "Abomination Hammer",
"type": "Weapon",
"level": 0,
"rarity": "Fine",
"vendor_value": 0,
"default_skin": 5014,
"game_types": [
"Activity",
"Wvw",
"Dungeon",
"Pve"
],
"flags": [
"NoSell",
"SoulbindOnAcquire",
"SoulBindOnUse"
],
"restrictions": [],
"id": 15,
"chat_link": "[&AgEPAAAA]",
"icon": "https://render.guildwars2.com/file/E8507FFB6CF3C9094A69956344CEDBD9B47D95B6/434872.png",
"details": {
"type": "Hammer",
"damage_type": "Physical",
"min_power": 146,
"max_power": 165,
"defense": 0,
"infusion_slots": [],
"attribute_adjustment": 20.736,
"infix_upgrade": {
"id": 112,
"attributes": []
},
"secondary_suffix_item_id": ""
}
}
I doubt it's the code now. That is what was supposed to be returned. It's the same code unedited and ran multiple times on both my phone and computer and the results are always the same.
Here's the line of code I wrote:
function getRequest() {
var response = UrlFetchApp.fetch('https://api.guildwars2.com/v2/items/15');
Logger.log(response)
}
Can anyone help? I'm really frustrated now.