Search API Connector Documentation

Print

Import Okta Data to Google Sheets

In this guide, we’ll walk through how to pull Okta's API data directly into Google Sheets, using the API Connector add-on for Sheets.

We'll first get an API key, and then set up a request.

Contents

Before You Begin

Click here to install the API Connector add-on from the Google Marketplace.

Part 1: Get Your Okta API Key

  1. While logged in to your Okta dashboard, navigate to Security > API from the top navigation bar.
    okta-img1
  2. From the API menu, click Tokens, and then click Create Token.
    okta-img2
  3. Give your token a name and click Create Token
    okta-img3
  4. You will now be presented with your token. Congrats, you now have access to the Okta API! Copy this value and keep it handy as you'll need it in a moment.
    okta-img4

Part 2: Create Your Okta API Request

We’ll start by getting a list of users in your organization.

  • API root: https://YOUR_DOMAIN.okta.com/api/v1
  • Endpoint: /users

Putting it all together, we get the full API Request URL:

https://YOUR_DOMAIN.okta.com/api/v1/users

Part 3: Pull Okta API Data into Sheets

Now let's enter that URL into API Connector.

  1. Open up Google Sheets and click Extensions > API Connector > Open.
  2. In the Create screen, enter the Request URL we just created
    okta-img5
  3. Under Headers, enter three sets of key-value pairs like this:
    Content-Typeapplication/json
    Acceptapplication/json
    AuthorizationSWSS YOUR_TOKEN

    Replace YOUR_TOKEN with the token you got above in part 1. You must include the text 'SWSS' before it.
    okta-img6

  4. Create a new tab and click Set Current to use that tab as your data destination.
  5. Name your request and click Run. A moment later you’ll see a list of your Okta users populate your Google Sheets.
    okta-img7

Part 4: Handle Pagination

Note that the Okta API limits the number of records returned in each request. By default, only the first page of records will be returned, and each page contains a limited number of records. To access more than 100 records, use the "limit" and "after" parameters as described in the documentation.
okta-img8

Okta provides the full next page URL in the Link header, so you can run through these URLs automatically with pagination handling (paid feature), like this:

  • Pagination: next page URL
  • Next page path: Link
  • Run until: choose when to stop fetching data
    pagination-nextpageurl-Link

Part 5: API Documentation

Official API documentation: https://developer.okta.com/docs/reference/#core-okta-api

Leave a Comment

Jump To...