Zathuw.4209 Posted February 12 Share Posted February 12 (edited) Hey hi, is there any reason that i cant use the gw2 api on google sheet? I have to use others websites api (gw2spidy or gw2tp etc) but recently i wanted to access my tp history on google sheet but only the gw2 api is giving me this information, i know my code is right since its working with others API but i feel like the official gw2 api is blocked on google sheet, anyone knows anything about it? Thx! edit: i have no error codes, just blank cells. Edited February 12 by Zathuw.4209 Link to comment Share on other sites More sharing options...
GODh.3892 Posted February 13 Share Posted February 13 No, afaik there is no reason... if your request is valid then you should receive an answer with data. Link to comment Share on other sites More sharing options...
blackicedragon.3579 Posted February 14 Share Posted February 14 (edited) Quote function apiFetch(key, url){ var data; if(key){ var opt = { 'headers': { 'Authorization': 'Bearer ' + key, 'muteHttpExceptions': true } }; data = UrlFetchApp.fetch('https://api.guildwars2.com/v2/' + url, opt); data = data.getContentText(); } return JSON.parse(data); } 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 Edited February 15 by blackicedragon.3579 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now