GAS script for polling the WoW Character API, retrieving character information, and pasting into a character spreadsheet.
- Script only works for one realm, and defaults to Shadowsong -- see "Personalize The Script" below to change this
- Script will return only the values you want (level, race, item level, etc.) and ignore others
- Script returns null values for any blanks in the character name cell range, or for any 404 "character not found" errors
- Most common causes of a 404:
- Your character name is misspelled in your spreadsheet - double check any fancy characters!
- Your character is not in the API database (i.e. under level 10)
- I don't know how long it takes for this database to update after you hit level 10, but in testing it seems to take over 24 hours
- You can check by going to worldofwarcraft.com and searching for your character, if they appear in search results then they should appear in the API
- Most common causes of a 404:
Follow ALL of these steps. If you do not do this correctly, I am not responsible for any loss of very very critical character spreadsheet data!
- Open your spreadsheet in a web browser. It MUST be hosted in Google Sheets for any of this to work!
- In the menu bar, choose Extensions > Apps Script, your browser will open a script editor in a new tab
- Delete all the text in the editor so the file is blank
- Copy the contents of the Update Script (found here) and paste into the script editor
- In the script editor menu bar, click the Save icon and verify there are no errors
- Make sure you have your spreadsheet open to the correct sheet in another tab (if you just did the above section then you are set)
- In the menu bar of the script editor, find the drop down where you can choose a function and choose "onOpen," then click Run
- A pop-up will appear asking for authorization, this is granting the script read/write access to your spreadsheet
- Click Review Permissions, then choose your correct Google account, then you will see a "Google hasn't verified this app" warning, click "Advanced," then "Go to Untitled project," then "Allow"
- You should see the Execution log appear and post "Execution completed," go back to your spreadsheet and verify you now see a menu bar item "WoW API" with option "Update Character Info" - do not actually run it yet!!
- You have to do one of two things in order to access the Blizzard API, either a.) follow the instructions below for access to my API token, or b.) set up your own API access. I can walk you through the latter if you wish.
- If you want to use my API token / "library," send me the email address of your Google account that owns your spreadsheet
- I will add your account to my library whitelist, and then respond with a "Script ID"
- In the script editor window, on the left side find "Libraries" and then click the + to add a new library
- Paste in the script ID, click "Look up", you should see BResWoWAPIToken
- Make sure you choose the latest version (probably version 2) and then click 'Add'
- Look at the top of the script for the section "function personalize()", underneath that are several lines with comment labels
- The first two (realmName and rangeOfNames) are mandatory and the script will fail if either of these are empty or misspelled
- The next several lines are optional. If you want the listed value to be returned, enter the cell range between the quotation marks. Use the existing settings as examples
- If you DON'T want the listed value to be returned, just leave the quotation marks with nothing between them. Use the existing settings as examples
- Once all the values are correct for what you want, Save the script again
- Go back to your spreadsheet, from the menu bar choose WoW API > Update Character Info
- You will get another request to authorize spreadsheet access, follow the same steps as before
- Cross your fingers neither of us messed anything up and it works the first time!
- If something goes wrong and you overwrite the wrong cells, simply Edit > Undo in the spreadsheet