Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Contact Us
  • Home
  • API, CLI, and SDK Documentation
  • REST API Documentation
  • Connections Using REST API
  • Platform Specific REST API Documentation
  • Box

Box Service Account (REST API)

Create a Box Service Account connection using the DryvIQ REST API.

Written by Andrea Harvey

Updated at April 29th, 2025

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Insights
    Prebuilt Insights Custom Insights
  • Content
  • Accounts
  • Activity Log
  • Content Scans
  • Migrations
    Migration Jobs Migration Reports Maps Flagged Items Migration Tools
  • Connections
    Supported Platform Connections Creating Connections Connection Maintenance Connection Pools
  • Entity Types
    DryvIQ Available Entity Types Custom Entity Types Entity Type Maintenance
  • Action Sets
    Creating Action Sets Action Sets Maintenance
  • Settings
    License Performance Notifications Extensions Entity Types Settings Display Settings Configuration
  • API, CLI, and SDK Documentation
    REST API Documentation Command-line Interface SDK Development
  • POC Offering
  • Release Notes
+ More

Table of Contents

Creating a Connection to Access All Users (enterprise_id) Creating a Connection Using Single Account Impersonation (user_id) Creating a Job

Creating a Connection to Access All Users (enterprise_id)

Use the Enterprise ID to list content for all users on your connection root. Box Service Account connections require Administrator privileges to use the impersonation feature. Co-administrators do not have the required permissions to perform impersonation.

POST {{url}}v1/connections/
{
   "name": "Box Service Account (Access All Users)",
   "platform":{
       "id":"box-service"
   },
   "auth":{
       "private_key":"-----BEGIN ENCRYPTED PRIVATE KEY-----\#########----END ENCRYPTED PRIVATE KEY-----\n",
       "password":"{{passphrase}}",
       "client_id":"{{clientID}}",
       "client_secret":"{{clientSecret}}",
       "public_key_id":"{{publicKeyID}}",
       "enterprise_id": "{{enterpriseID}},"
        "delete_behavior": "permanent"
   }
}

Creating a Connection Using Single Account Impersonation (user_id)

Use the user_id to impersonate a single account.

POST {{url}}v1/connections/
{
   "name": "Box Service Account (UserName)",
   "platform":{
       "id":"box-service"
   },
   "auth":{
       "private_key":"-----BEGIN ENCRYPTED PRIVATE KEY-----\#########----END ENCRYPTED PRIVATE KEY-----\n",
       "password":"{{passphrase}}",
       "client_id":"{{clientID}}",
       "client_secret":"{{clientSecret}}",
       "public_key_id":"{{publicKeyID}}",
       "user_id": "{{userID}},"
        "delete_behavior": "permanent"
   }
}

Creating a Job

The path should include impersonation. Box Service Account connections require Administrator privileges to use the impersonation feature. Co-administrators do not have the required permissions to perform impersonation.

POST {{url}}v1/jobs
{
   "name":"Simple Job",
   "kind": "transfer",
   "transfer": {
     "transfer_type": "copy",
       "source": {
           "connection": { "id": "{{BoxServiceAccount_connection_sourceID}}" },
            "impersonate_as": { "email": "user@company.com" },
           "target": {
               "path": "/sourceFolder"
           }
       },
       "destination": {
           "connection": { "id": "{{OneDriveForBusiness_connection_destinationID}}" },
           "target": {
               "path": "/Documents/destinationFolder"
           }
       },
       "simulation_mode": false
   },
   "schedule": {
       "mode": "manual"
   },
   "stop_policy": {
       "on_success": 5,
       "on_failure": 5,
       "on_execute": 25
   },
   "category": {
     "name": "Report {Name}"
   }
}

 

api rest api connection box service account

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Box (REST API)
  • Connection Management Using REST API
  • Configuring the SMTP Server Using REST API

Copyright 2025 – DryvIQ.

Knowledge Base Software powered by Helpjuice

Expand