Back

Smartsheet API Essential Guide

Aug 11, 20246 minute read

What type of API does Smartsheet provide?

Smartsheet uses a REST API. Here are the key points about Smartsheet's API:

Type of API

Smartsheet has a RESTful API. The API is designed to be simple and intuitive, based on widely accepted standards and conventions including REST, JSON, and HTTP.

Key Characteristics

  • It uses REST URL structure following typical resource-oriented conventions
  • It uses JSON for data formatting
  • It uses standard HTTP methods and status codes
  • Authentication is done via OAuth 2.0 or API access tokens
  • The base URL is https://api.smartsheet.com/2.0/

API Capabilities

The Smartsheet API allows developers to:

  • Read and update sheets
  • Manage folders and workspaces
  • Administer user accounts and organization plans

SDKs Available

Smartsheet provides official SDKs for several programming languages to make working with the API easier:

  • C#
  • Java
  • Node.js
  • Python
  • Ruby

Best Practices

Some best practices for using the Smartsheet API include:

  • Using OAuth 2.0 for authentication when building third-party apps
  • Leveraging the SDKs when possible for easier development
  • Referring to the API documentation for details on endpoints and request/response formats
  • Using the Developer Portal resources for guidance

Does the Smartsheet API have webhooks?

Yes, the official Smartsheet API does support webhooks. Here are the key points about Smartsheet webhooks:

Webhook Support

  • Smartsheet offers webhook functionality as part of their API.

  • Webhooks allow you to subscribe to event notifications (callbacks) for specific Smartsheet objects.

Event Types

You can subscribe to the following types of events:

  • Currently, "." is the only supported value for the events attribute. This indicates a subscription to all objects in the scope, and all events for those objects.

  • Some examples of events that can trigger webhooks include:

    • Changes to a sheet
    • New rows added to a sheet
    • Cell values changed in a sheet

Webhook Setup

  • To set up a webhook, you need to specify:

    1. Which Smartsheet object to monitor (e.g. a specific sheet)
    2. Which events to trigger on (currently only "." is supported)
    3. The HTTPS callback URL where Smartsheet should send notifications
  • Webhooks are created and managed through the Smartsheet API.

Callback Payload

  • The webhook callback payload is a "skinny" payload - it indicates which objects changed and the event types, but does not contain the actual changed data.

  • Your application will need to make additional API calls to retrieve the full details of what changed.

Best Practices

  • Use HTTPS for the callback URL
  • Implement verification of webhook callbacks for security
  • Handle webhook status changes (e.g. if access is lost)

In summary, Smartsheet webhooks provide a way to get notified about changes to sheets and other objects, allowing you to build integrations that can react to events in near real-time. The current implementation is fairly broad in terms of event types, but gives you flexibility to subscribe to all changes on a given sheet.

Rate Limits and other limitations

Here are the key points about the API rate limits for the Smartsheet API:

  1. The current rate limit is 300 requests per minute per access token.

  2. Certain resource-intensive operations, such as attaching a file or getting cell history, count as 10 requests toward the rate limit.

  3. If you exceed the rate limit, subsequent API requests within a one-minute period will return a 429 HTTP status code, along with a JSON response body containing an error message.

  4. The error response looks like this:

{ "errorCode": 4003, "message": "Rate limit exceeded." }
  1. It's recommended to design your integration to handle this rate limit error gracefully. Some approaches include:

    • Sleeping for 60 seconds when encountering the error, then retrying the request
    • Implementing exponential backoff (progressively longer wait times between retries)
  2. Avoid executing API requests in rapid-fire succession to update the same Smartsheet object repeatedly within a short period.

  3. For maximum efficiency, consider batching changes and submitting them in a single request using "bulk"-enabled operations (e.g., Update Rows or Add Columns).

  4. Execute requests serially (one at a time) when updating a specific Smartsheet object to avoid errors due to save collisions.

  5. The SDKs provided by Smartsheet implement default backoff and retry mechanisms to handle rate limiting responses.

  6. There are additional limitations on various operations, such as a maximum of 500 rows per add/update request, a 500,000 cell limit per sheet, and a 4,000 character limit per cell.

To handle rate limiting in your Python code, you may need to catch the exception thrown by the SDK when a rate limit is exceeded, rather than checking the status code directly. Consider implementing a retry mechanism with exponential backoff to handle these cases automatically.

Latest API Version

The most recent version of the Smartsheet API is 2.0.

Key points to consider:

  1. The current API version is 2.0, which should appear in every API path you use [4].

  2. There is no planned sunset date for API version 2.0 at this time [4].

  3. Smartsheet does not have a planned release date for a new API version (e.g., 3.0) in the foreseeable future [4].

  4. For increased functionality to specific endpoints, Smartsheet uses a query parameter "level=" followed by an integer (e.g., 1 or 2). However, using "level=0" or omitting the level parameter provides base functionality [4].

  5. The API documentation was last updated on July 12, 2024 [1].

Best practices:

  1. Always use the most recent API version (2.0) in your implementations.

  2. Keep an eye on the Smartsheet API documentation for any updates or changes.

  3. When using specific endpoints, consider using the appropriate "level" parameter for additional functionality if needed.

  4. Be aware that while the core API version remains stable, individual endpoints may have different levels of functionality available.

  5. Check the API documentation regularly for any deprecation notices or new features.

How to get a Smartsheet developer account and API Keys?

To get a developer account for Smartsheet and create an API integration, you can follow these steps:

1. Explore Developer Resources

  • Visit the Smartsheet Developer Portal which is the main hub for all developer resources.
  • Review the API documentation, information about Smartsheet SDKs, and other resources available there.

2. Register for a Developer Account

  • Go to https://developers.smartsheet.com/register/ to register for a Smartsheet Developer account.
  • This will allow you to:
    • Add Developer Tools to an existing Smartsheet account
    • Create a separate sandbox Smartsheet account for development/testing
    • Build third-party applications using OAuth 2.0

3. Complete Your Developer Profile

  • After registering, log in to your Smartsheet account and access the "Developer Tools" section.
  • Fill out any required fields in your developer profile.

4. Register Your Application

  • In the Developer Tools section, register your application.
  • Provide details like:
    • App name
    • Description
    • App URL
    • Contact/support info
    • Redirect URL for OAuth
  • Smartsheet will assign your app a client ID and client secret.

5. Generate an Access Token

  • For direct API access, you'll need to generate an API access token.
  • You can do this in the Smartsheet UI by logging in and following the instructions to generate a token.

What can you do with the Smartsheet API?

Here's a list of the main data models you can interact with using the Smartsheet API, along with what's possible for each:

Sheets

  • Read sheet data, including rows, columns, and cell data
  • Create new sheets
  • Update existing sheets (add/update/delete rows, columns, cells)
  • Delete sheets
  • Share sheets
  • Attach files to sheets
  • Add/manage discussions and comments
  • Publish sheets

Rows

  • Add new rows to sheets
  • Update existing rows
  • Delete rows
  • Move rows
  • Copy rows between sheets

Columns

  • Add new columns to sheets
  • Update column properties
  • Delete columns
  • Reorder columns

Cells

  • Update cell values and properties
  • Upload attachments to cells
  • Add/remove hyperlinks in cells

Workspaces

  • Create new workspaces
  • Update workspace properties
  • Delete workspaces
  • Share workspaces
  • Move/copy sheets and folders between workspaces

Folders

  • Create new folders
  • Update folder properties
  • Delete folders
  • Move/copy folders

Reports

  • Create new reports
  • Run reports
  • Update report properties
  • Delete reports
  • Share reports

Users and Groups

  • Add/remove users
  • Update user information
  • Create and manage groups
  • Add/remove users from groups

Attachments

  • Upload attachments to sheets, rows, and cells
  • Download attachments
  • Delete attachments

Comments and Discussions

  • Add comments to sheets and rows
  • Update comments
  • Delete comments
  • Manage discussions

Forms

  • Create forms connected to sheets
  • Update form properties
  • Delete forms

This covers the main data models and operations available through the Smartsheet API. The API provides extensive capabilities for programmatically managing Smartsheet data and resources.