How to Connect to Box.com with OAuth 2.0

Document created by brian_otoole Employee on Oct 13, 2016Last modified by Adam Arrowsmith on Jun 13, 2017
Version 6Show Document
  • View in full screen mode

This article describes how to connect to Box.com using HTTP Client Connector with OAuth 2.0 authentication.

 

 

Use Case

Provide the ability to connect AtomSphere with the Box.com REST API using the OAuth 2.0 protocol for authentication.

 

Approach

The approach will use the AtomSphere HTTP Client Connector to interact with the Box.com REST API and retrieve a list of Box.com user accounts. While doing so we will configure the necessary OAuth 2.0 settings in accordance with Box.com’s implementation of OAuth 2.0.

 

The approach consists of the following steps:

  1. Use the AtomSphere HTTP Connector to initiate and execute REST based requests against Box.com.
  2. Configure a sample Box.com application and authorize the respective Boomi AtomSphere process.
  3. Configure the required authentication settings within the HTTP Client Connector in accordance with Box.com OAuth 2.0 parameters.
  4. Perform a simple request to retrieve Box.com user accounts

 

Implementation

The following steps detail how to deploy a process using the AtomSphere HTTP Client Connector when connecting to Box.com’s REST API:

 

  1. Create Box.com Application
  2. Record the Box.com OAuth 2.0 Parameters for reference later
  3. Design a Boomi AtomSphere Process using the HTTP Client Connector
  4. Configure HTTP Client Connector with the respective Box.com OAuth 2.0 parameters recorded previously
  5. Specify the proper resource path for the Box.com REST API Endpoint to retrieve users.

 

1. Create Box.com Application

Navigate to https://app.box.com/developers/services/edit/ and follow the instructions to create a new Box Application:

 

 

2. Specify Box.com OAuth 2.0 Parameters

 

 

Note the following parameters to use later when configuring the HTTP Client Connector:

 

Box.com OAuth 2.0 ParameterValue
client_idml0yrwnjsv7ywyvjct4op3eq1afgksos - [sample ID]
client_secretv5u0Ha0ig05OrFfPQjC1afO1dztp0bOp - [sample secret]
redirect_urihttps://platform.boomi.com/account/[ATOMSHERE_ACCOUNT_ID]/oauth2/callback 

 

3. Start to Build a Sample AtomSphere Process


Design a simple integration process to validate your Box.com connection. Bypass the HTTP Client Connection and Operation until the next step:

 

 

4. Configure your HTTP Client Connection and Operation

 

1. Configure the HTTP Client Connection with the following parameters:

 

FieldValue
URLhttps://api.box.com/2.0 
Authentication TypeOAuth 2.0
Grant TypeAuthorization Code
Client IDml0yrwnjsv7ywyvjct4op3eq1afgksos - [sample ID]
Client Secretv5u0Ha0ig05OrFfPQjC1afO1dztp0bOp - [sample secret]
Authorization Token URL

https://account.box.com/api/oauth2/authorize 

Scope<Intentionally left blank for this example>

Authorization Parameters

(Name | Value)

Authentication Parameters

(Name | Value)

None (leave blank)
Access Token URLhttps://api.box.com/oauth2/token

 

2. After defining the parameters, click the “Regenerate” button to regenerate the Access Token. This token will be saved and used for future requests against Box.com.

 

 

5. Configure the HTTP Client Connector Operation

Since we are performing a simple GET request there is no need for a request profile, however there is a JSON response profile specified. A sample of the JSON response is provided below in addition to this screenshot of the operation:

 

 

6. Validation

With a simple test run of the process, the HTTP Client should be able to make a successful connection to https://api.box.com/2.0/users and retrieve a complete JSON response provide detailed below.

 

 

 

Sample JSON Response:

{
  "total_count": 1,
  "entries": [
    {
      "type": "user",
      "id": "341312345",
      "name": "Test Account1",
      "login": "test@test.box.com",
      "created_at": "2016-09-12T09:52:19-07:00",
      "modified_at": "2016-09-12T09:52:19-07:00",
      "language": "en",
      "timezone": "America/Los_Angeles",
      "space_amount": 10737418240,
      "space_used": 0,
      "max_upload_size": 2147483648,
      "status": "active",
      "job_title": "",
      "phone": "",
      "address": "",
      "avatar_url": "https://app.box.com/api/avatar/large/341312345"
    }
  ],
  "limit": 100,
  "offset": 0
}
3 people found this helpful

Attachments

    Outcomes