How to connect the ShipBob API to Google Sheets

ShipBob is a global logistics platform that fulfills ecommerce orders for direct-to-consumer brands. We can use the ShipBob API to import data from ShipBob into Google Sheets. In this tutorial, we’ll show you how to connect the ShipBob REST API to Google Sheets in 5 steps:

  1. Install the Apipheny add-on
  2. Obtain an access token
  3. Choose a ShipBob endpoint
  4. Enter your ShipBob API request into Apipheny
  5. Run the ShipBob API request in your Google Sheet

Step 1.) Install and open the Apipheny add-on for Google Sheets

Apipheny is a free API connector for Google Sheets. You can use Apipheny to connect your Google Sheets to API data sources, easily.

1.) Install Apipheny by opening the following link on desktop and then clicking the Install button in the Google Marketplace: https://apipheny.io/install

2.) After you’ve installed Apipheny, open a Google Sheet and then click on the Extensions dropdown in the menu at the top.

In the dropdown list you should see Apipheny. Click Apipheny then click Import API to open the Apipheny sidebar in your Google Sheet.

open apipheny

Tip: you can open a new Google Sheet by entering this URL in your browser: sheet.new

Step 2.) Obtain an access token

In your account Dashboard section, go to Integrations and then choose Manage API Tokens:

The Dashboard section
The Dashboard section

In your PAT section, click the blue Generate New Token button:

Personal Access Token section
Personal Access Token section

A sidebar will expand on the right side of your screen. Complete the token name and description, then click the Generate Token button:

Generating the personal access token
Generating the personal access token

Copy the generated token to a safe location, then click the Confirm and Close button:

Confirmation section
Confirmation section

Step 3.) Choose a ShipBob endpoint

In this section, we’ll show you how to browse the ShipBob API documentation to find the endpoint that retrieves the information you need from your account. If you already know your API URL, or you want to use the same example URL as us, just skip to Step 4.

First, open the ShipBob API documentation page: https://developer.shipbob.com/api-docs

This page contains a list of categorized endpoints:

ShipBob API documentation page
ShipBob API documentation page

If we click the Products category, its description and the corresponding endpoints will be displayed on the screen:

The Products category
The Products category

An example endpoint is Get Multiple Products, which returns all products. The URL for this endpoint is:

https://api.shipbob.com/1.0/product

The endpoint’s documentation contains the authorization method, the query parameters, the HTTP method (GET) and URI and several response samples:

Endpoint documentation
Endpoint documentation

All endpoints can be accessed using the following base domain: https://api.shipbob.com/1.0/

All endpoints are appended to this base domain.

More ShipBob API endpoint examples

The Get multiple products endpoint, which gets a list of products:

Method: GET
API URL Path: https://api.shipbob.com/1.0/product
Headers:
    Header 1 Key:
       Authorization 
    Header 1 Value:
       Bearer your_auth_token

Make sure to replace your_auth_token with the token you previously obtained.


The List inventory items endpoint, which lists the inventory items:

Method: GET
API URL Path: https://api.shipbob.com/1.0/inventory
Headers:
    Header 1 Key:
       Authorization 
    Header 1 Value:
       Bearer your_auth_token

Make sure to replace your_auth_token with the token you previously obtained.


The Get user-authorized channel info endpoint, which gets the info about the user-authorized channel:

Method: GET
API URL Path: https://api.shipbob.com/1.0/channel
Headers:
    Header 1 Key:
       Authorization 
    Header 1 Value:
       Bearer your_auth_token

Make sure to replace your_auth_token with the token you previously obtained.


The Get locations endpoint, which gets a list of locations:

Method: GET
API URL Path: https://api.shipbob.com/1.0/location
Headers:
    Header 1 Key:
       Authorization 
    Header 1 Value:
       Bearer your_auth_token

Make sure to replace your_auth_token with the token you previously obtained.

ShipBob API pagination

Pagination is a process that is used to divide a large dataset into smaller chunks (pages). Usually the endpoints that return a list of resources support pagination. 

Some of the ShipBob API endpoints use the pagination option. This means you need to add some of these parameters at the end of the URL:

  • page – the number of the page you want to obtain;
  • limit – Amount of data per page to request;

You can also add SortOrder, if you want to sort your data. This is order to sort results in, and the values are either “Newest” or “Oldest” (without the quotes).

Each endpoint that may need pagination will have in its documentation relevant information about the parameters you may add to paginate your results.

Example:
https://api.shipbob.com/1.0/order?page=3&limit=150

In the example above, the data set will be divided in sets of 150 records per page, and only the third page (page number 3) will be displayed in Google Sheets.

Example with the SortOrder parameter:
https://api.shipbob.com/1.0/order?page=3&limit=150&SortOrder=Newest

Step 4.) Enter your API request into Apipheny

Now go back to your Google Sheet and make sure that the Apipheny add-on is open on the “Import” tab. With the Import tab open, enter these details into the add-on:

Method: At the top of the Apipheny sidebar, select the HTTP method (GET or POST) required by your API endpoint. For this example, we are using the GET method.

API URL: In Step 3, we explained how you can find the ShipBob REST API endpoint that you need. Now copy and paste your complete ShipBob API URL into the Apipheny add-on, where it says API URL Path, followed by any parameters required for your query (if applicable).

For this example, we are using the Get Orders endpoint, which retrieves all orders. This is what the whole URL looks like for this endpoint:

https://api.shipbob.com/1.0/order

Headers: In the Headers section of Apipheny, add one row with the following key and value:

Header
Key:
Authorization 
Value:
Bearer your_auth_token

For the header value, enter the word Bearer, then a space, then replace your_auth_token with the value of the token you obtained previously, in Step 2.

  ShipBob API request entered into Apipheny
ShipBob API request entered into Apipheny

Step 5.) Run the API request in your Google Sheet

Finally, the last step is to click the Run button at the bottom of the Apipheny add-on and then wait for the ShipBob API data to be imported into your Google Sheet. Here’s what our request looked like when completed:

  ShipBob data imported into Google Sheets
ShipBob data imported into Google Sheets

That’s it! You’ve successfully connected your ShipBob account to Google Sheets using the ShipBob API, Google Sheets API, and the Apipheny add-on.

After making a successful request to the ShipBob API, try querying a different ShipBob API endpoint, or try using one of the more advanced features in the Apipheny add-on.



Crypto API Tutorials:


Popular API Tutorials


API Knowledge

What is an API?

What is an API URL?

What are parameters?

What is an endpoint?

What is an API key/token?

What is basic authentication?

What are headers?

What is a GET request?

What is a POST request?