The Rest API connector transforms data to a flattened JSON format. Specifically, the connector flattens all nested data into a single layer of key pairs in a single table.
Note

The maximum JSON result is 500 Kb and the data cannot have more than 1,000 columns.

Set up a new connection

Complete the following steps to set up a connection in Minitab Connect.
  1. From the Home screen, select the Add button under Tables.
  2. In Datasets, enter Rest API and select the connector from the results.
  3. Enter a Name that identifies the connection.
  4. From Authentication, select one of the following options.
    Basic Authentication
    Enter the credentials for the RESTful web service.
    API Key/Token
    Enter the API key and value. From Desired Authentication Parameter Type if you select Header Parameter you can make GET and POST requests. If you select Body Parameter you can only make POST requests.
    Bearer Token
    Enter the Token.
    JWT Token
    Select to generate JWT tokens and add them to the request. From Desired Authentication Parameter Type if you select Header Parameter you can make GET and POST requests. If you select Body Parameter you can only make POST requests.
    From Algorithm, select either a HS, RS, or ES algorithm. If you select HS, enter a Secret to use with the algorithm. If you select RS or ES, Connect creates a JWT Public Key after you save the connection.
    OAuth 2.0
    Select to access data with OAuth 2.0. For more information about the options for this authentication method, go to the Set up a new connection with OAuth 2.0 section.
    None
    Select if your web service does not require a username and password or an API key
  5. Select Save .

After you save the connection, Connect displays options to import data into a new table. Start at step 4 of the Create a table with data from a connection section for more information on importing data to create a table.

Set up a new connection with OAuth 2.0

Complete the following steps to set up a connection in Minitab Connect with the OAuth 2.0 authentication method. Accessing data with OAuth 2.0 usually involves a few requests back and forth between Connect and the API.
  1. From the Home screen, select the Add button under Tables.
  2. In Datasets, enter Rest API and select the connector from the results.
  3. Enter a Name that identifies the connection.
  4. From Authentication, select OAuth 2.0.
  5. From Desired Authentication Parameter Type if you select Header Parameter you can make GET and POST requests. If you select Body Parameter you can only make POST requests.
  6. From Grant Type, select one of the following options.
    Authorization Code
    Select to authenticate with the API service provider. An authorization code is sent back to the client app, extracted, and exchanged with the provider for an access token to authenticate future requests.
    Implicit
    Select to return an access token without requiring the extra authorization code step. This makes it less secure.
    Password Credentials
    Select to send a username and password directly from the client. If you select this grant type, you have to enter the Username and Password for your API provider.
    Client Credentials
    Use to access data associated with the client application.
  7. The following is the full list of options to request a new access token. They depend on your grant type.
    Callback URL
    Enter the URL that you want to be redirected to after authorization. You must add this URL to your application's registered Callback URLs.
    Auth URL
    Enter the endpoint for the authorization server that you want to use to get the authorization code. Include any non-standard parameters that the service requires.
    Access Token URL
    Enter the endpoint for the authorization server that you want to use to get the access token.
    Refresh Token URL
    Enter the endpoint for the authorization server that you want to use to refresh the access token if it is different than the Access Token URL.
    Client ID
    The ID for your client application that you registered with the API provider.
    Client Secret
    The client secret you received when you registered with the API provider.
    Scope
    The scope of the access request. Separate multiple scopes with a space.
  8. If you selected Authorization Code or Implicit as your grant type, you must select Click to authorize before you can save the connection.
  9. Select Save .

After you save the connection, Connect displays options to import data into a new table. Start at step 4 of the following section for more information on importing data to create a table.

Create a table with data from a connection

Complete the following steps to import a data file from an API and create a new table in Connect.
  1. From the Home screen, select the Add button under Tables.
  2. In Datasets, enter Rest API and select the connector from the results.
  3. Under Connection, select the Rest API connection that you previously set up. If you have not previously set up a connection, select New Connection and follow the steps in the previous section.
  4. On the left panel, enter a Name that identifies the table and select a Folder to save the table.
  5. Under Update Frequency, specify how often you want Connect to update the table. You can import the data one time or have Connect continuously import the data at a set time interval. Connect automatically creates a flow for your import. If you select Once, you can use the flow at a later time to automatically run the import again.
  6. Under URL, enter the base request URL. You'll add parameters later.
  7. From Request Type, select either a HTTP GET request or a HTTP POST request.
  8. In Maximum Array Depth, select the maximum depth in which Connect converts JSON data nodes into table columns. The JSON string data becomes the cell value result when Connect reaches the maximum depth. By default, the maximum array depth is 5.
  9. Select Next.
  10. In Request Header Parameters and Request Body Parameters , enter the request parameters that you want to send.
  11. No fields are available initially. Select Add Parameter to add key pairs to the request URL parameters.
  12. In Array Key for Records (Root Path), enter the comma separated path to the node.
  13. Select Save . If you go to the Prep Tool and select Run , Minitab Connect displays the imported data.
    Note

    If no data appears after you select Run, select Reset Config .

When you save the import, Connect creates a flow with the settings that you selected. For more information on how to schedule a flow and add more data processes to clean data, go to Overview of the Flow Tool .

JSON Flattening Logic

Connect flattens the JSON results to properly represent them as a table. Flattening means to put the JSON into a single hierarchy structure so that there are no child or parent objects. Columns can then be represented since everything is a key-value pair. Nested objects are displayed by a dot operator in the column name.