Many of our customers use the Smartsheet application programming interface (API) to set up processes to organize and accelerate their workflows so their team can make a bigger impact. But what if you need to automate and scale workflows throughout your entire organization?
Once you move beyond the basics of the Smartsheet API, you can learn more advanced strategies to benefit your company at large. While the transition from building integrations for yourself to building for others can be challenging, the reward is certainly worth the effort.
Read on to learn about how you can establish a secure connection to the Smartsheet API, then automate processes and optimize your integration to scale.
1. Secure Your Data With OAuth Flow
The people who will use your integration need to be able to interact with their Smartsheet data in a safe and secure way. The OAuth 2.0 standard, which is an open, widely-supported authorization protocol, helps to promote secure connections with third-party applications.
Implementing a Smartsheet OAuth Flow means others can use your integration to interact with their Smartsheet data without any sensitive information (username, password, etc.) actually changing hands.
2. Automate Processes Using Webhooks
Another important consideration is process automation, especially if your integration needs to respond to changes in your Smartsheet data. Currently, there are two options available to you:
Periodically call the Smartsheet API to check for changes (use Get Sheet Version).
Get notified of changes automatically through use of Smartsheet webhooks.
We strongly recommend using webhooks, which is the more efficient option. This sample webhook implementation is a good starting point to build and test your webhook locally. At the time of writing, the scope of a webhook is limited to all events on a sheet. In other words, a webhook can only listen for changes on a single sheet and will trigger based on all saved changes to a sheet.
The payload of a webhook is deliberately thin: it tells you where something changed rather than what changed. You’ll need to make a second call to the Smartsheet API to pull the relevant sheet data into your integration.
3. Scale Your Integration
If your integration will be used by others, then you must carefully consider how it will handle heavy loads. Specifically, you need to think about how your integration will interact with the Smartsheet API at a higher volume.
This can be narrowed down to three main concerns: being smart about API usage, having a system for logging, and handling errors gracefully. It’s also important for you to be deliberate and efficient about making calls to the Smartsheet API. Many endpoints can perform bulk operations, allowing you to consolidate calls.
For example, instead of updating a single row 60 times, you can call Update Rows once on an object with 60 rows. Using bulk operations results in better performance, prevents save errors, and keeps you from hitting the rate limit.
At the time of writing, the Smartsheet API implements throttling at 300 requests per minute (this is subject to change). The best strategy for dealing with rate limit errors is to wait and retry your call.
These three tips are just the beginning. If you want to learn even more advanced tips for implementing the Smartsheet API, watch the video session from ENGAGE’18 below. We covered how to set up a webhook, deal with API rate limits, programmatically generate access tokens, and more: