API Connector Documentation
Import Bungie Data to Sheets
In this guide, we’ll walk through how to import Bungie data directly into Google Sheets, using the API Connector add-on for Sheets. We'll set up a custom OAuth connection and connect to their API.
Contents
- Before You Begin
- Part 1: Get Your Bungie OAuth Credentials
- Part 2: Connect the Bungie API to API Connector
- Part 3: Get Bungie Data in Sheets
- Part 4: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Get your Bungie OAuth Credentials
- Log in to Bungie.net and navigate to https://www.bungie.net/en/Application
- Click Create New App
- Fill in the form as follows:
- Application Name: enter any name
- Website: enter any website
- OAuth client type:
public
(orconfidental
) - Redirect URL:
https://script.google.com/macros/d/12COOkin8nodCH7fZGIBu0D2jWY8-AEA0uvElt4Ph4wRbLUD4wslqQUfG/usercallback
- Scope: select your scopes
- Origin header: leave blank
- Agree to the terms and click Create New App
- You'll now be presented with an API key and client ID. Copy these as we'll need them shortly.
Part 2: Connect Bungie to API Connector
- Open up Google Sheets and click Extensions > API Connector > Manage Connections
- Scroll to the bottom of the sidebar and click Add Custom OAuth
- Fill in the Custom OAuth modal as follows:
- OAuth Grant Type:
Authorization Code
- Name:
Custom Bungie
- Authorization Base URL:
https://www.bungie.net/en/OAuth/Authorize
- Token URL:
https://www.bungie.net/Platform/App/OAuth/token/
- Client ID: provided by Bungie
- Client Secret: leave blank if you created a public app; otherwise enter the client secret provided by Bungie
- OAuth Grant Type:
- Click Save
- Click Manage Connections to return to the list of connections
- Scroll down until you find your new custom connection. Click Connect
- You'll be prompted to give access to the new app you created above. Click Approve
- You'll be returned to your sheet and can verify that the new connection is now active.
Part 3: Get Bungie Data in Sheets
To create a request, include your full request URL in the request URL field, select your custom Bungie connection from the dropdown OAuth menu, and add an X-API-Key header key.
You can see information about endpoints and parameters in the API documentation. For example, to get user memberships, run a request like this. Substitute in your own API key where it says your_api_key
.
- Application:
Custom
- Method:
GET
- Request URL:
https://www.bungie.net/Platform/User/GetMembershipsForCurrentUser/
- OAuth:
Custom Bungie
- Headers:
X-API-Key
:your_api_key
Part 4: API Documentation
Official API documentation: https://bungie-net.github.io/