Skip to main content
This guide walks you through making your first API request to retrieve data from a linked account.
Prefer a no-code approach? Use the Request Tester in the dashboard to test API endpoints directly against linked accounts without writing any code.

Prerequisites

  1. API Key created in StackOne Dashboard and copied to a secure location
  2. Basic Authentication Setup - Learn how to properly authenticate with StackOne API using your API key
  3. Required provider integration enabled
  4. Account linked successfully
  5. (Optional) Use an SDK or Postman

Getting Account ID

Authentication: When using curl -u "$API_KEY:", encoding is handled automatically. When setting the Authorization header manually, you must base64 encode your API key first. See the Basic Authentication Guide for details.
  1. List your linked accounts to find the account ID:
curl --request GET \
     --url https://api.stackone.com/accounts \
     --header 'accept: application/json' \
     --header 'authorization: Basic {base64_encoded_api_key}'
  1. From the response, copy the id value for your desired provider account.
Filter by provider using the providers query parameter:
curl --request GET \
     --url 'https://api.stackone.com/accounts?providers={provider_name}' \
     --header 'accept: application/json' \
     --header 'authorization: Basic {base64_encoded_api_key}'

Making Your First Request

Now you’re ready to make your first Documents API call. Let’s list the drives available in the connected storage provider:
curl --request GET \
  --url 'https://api.stackone.com/unified/documents/drives' \
  --header 'accept: application/json' \
  --header 'authorization: Basic {base64_encoded_api_key}' \
  --header 'x-account-id: {account_id}'

Example Response

{
  "data": [
    {
      "id": "drive_123",
      "remote_id": "abc123",
      "name": "My Drive",
      "description": "Personal storage",
      "url": "https://drive.google.com/drive/..."
    }
  ]
}

Next Steps

References