Connect with Smartsheet using Webhooks

Dina Bennett
Dina Bennett
  • Updated

Use the Smartsheet Webhook integration to automatically create and update Smartsheet records. See updates in Smartsheet in real-time for new proofs, comments, decisions, and more. 

Available for administrators: Enterprise

You can create a flow that starts when a Ziflow event occurs. If you are new to flow creation and webhooks, see Understand automation flows (Connect) and Build flows with Webhook Zibots.


Get your Smartsheet API Key

To connect Ziflow with Smartsheet, you'll need to obtain an API Key from your Smartsheet account. 

API keys are only available in Smartsheet Business and Enterprise Plans.

  1. On the left navigation bar, select Account > Apps & Integrations.

  2. In the Personal Settings form, select API Access.

  3. In the API Access tab, select Generate new access token. 

    Smartsheet-generate-api-key.png
     

  4. Name the token that will be used for connecting with Ziflow. 

  5. Once the API key is generated, copy it and save it somewhere in the notepad.

    You can also revoke existing tokens in this tab if needed.


Finding Sheet ID

To build integration between Ziflow and Smartsheet, you'll need the Smartsheet Sheet ID, which will be  used to set up your Webhook Zibot.

  1. Open up your Sheet and go to File > Properties. 

  2. Copy the Sheet ID.

Smartsheet-get-sheet-ID.png


Finding column IDs

To build a proper integration between Ziflow and Smartsheet, you will also need Column IDs to have both systems in sync.

In your Sheet, create the columns you want to populate with Ziflow data. For this example, we created a Smartsheet Sheet with columns to populate from four fields from Ziflow: Proof Name, Proof Version, Status, and the Proof Public Link URL.

Columns in your Sheet

To retrieve your Smartsheet Column IDs, you'll need to use Postman or another API tool to call the Smartsheet API. Send a GET call to Smartsheet to retrieve the Column IDs associated with the columns you created.

 

Post a GET call for the following endpoint:

https://api.smartsheet.com/2.0/sheets/{Paste your SHEET ID here}

Select Bearer Token as your authentication method and paste the API key copied from your Smartsheet account.

Authorization = Bearer Token

This is how the response should look like:

Getting column IDs with Postman GET call

Save these column IDs because we'll be using them later on when configuring the Smartsheet Zibot.

Create a new flow

  1. Select Connect in Ziflow’s main navigation and select Create Flow.

    create-flow-open.png
     
  2. Select Ziflow as your flow’s application source.
  3. Enter a name for your flow.
  4. Select the event that will start the flow. See Ziflow events for a list of all Ziflow events and details on each setting.

    choose-event-ziflow.png
     
  5. Create your flow. Follow the examples below for additional guidance.

    Create a new row in Smartsheet from a new proof
    Update Smartsheet row based on new proof version
    Update Smartsheet row with approval decision and date

Create a new row in Smartsheet from a new proof

This flow will create a new row in your Smartsheet Sheet and update the columns you specify when you create a proof in Ziflow.

  1. Select the New proof/version Ziflow event and configure the fields and select Next.
  2. Select Webhook Zibot.
  3. Fill out the Webhook Zibot details. This Zibot will create a record in Airtable and update the columns you specify.

    Smartsheet-create-new-row.png

    Field Description
    Request type POST
    URL

    Enter your Smartsheet URL and the Sheet ID you copied in a previous step. 

    https://api.smartsheet.com/2.0/sheets/{sheet_id}/rows
    Request body

    Enter the JSON body referencing columns that you would like to update in Smartsheet with the columns and column IDs.

    The fields (proof_name_column_id, version_column_id, status_column_id, proof_public_url_column_id) should match fields existing IDs inside your Smartsheet columns.

    Columns in Smartsheet
    [{"toTop":true,
    "cells": [
    {"columnId": {proof_name_column_id}, "value": "{$.proof.name}"},
    {"columnId": {version_column_id}, "value": "V {$.proof.version}"},
    {"columnId": {status_column_id}, "value": "In Progress"},
    {"columnId": {proof_public_url_column_id}, "value": "{$.proof.public_link}"}
    ]}]
    Headers

    Create a header:

    Key: Authorization

    Value: Bearer {your generated Smartsheet API key}

    header-info.jpg

  4. Select Next. Save your flow.

Create custom properties

  1. Create a custom property in Ziflow to hold the Smartsheet Row ID information. 
    See the example:

    Smartsheet-create-ziflow-property.png
     

Add a Zibot to store the Smartsheet row ID

  1. Add a Update proof custom property Zibot to your flow after the webhook. This Zibot will get an Smartsheet row ID from Smartsheet to store that value in the custom property you just created and use it to tell Ziflow which record to update when there are updates from the Ziflow side (new version or approval status).

    Smartsheet-update-proof-custom-property-zibot.png
     
  2. Select the group that your new property is in and the property from the lists.
  3. In Provide text, add

    #{$.zibot[0].data.records.id}#
  4. Select Next and Save and Turn on.
  5. Test your flow by creating a sample proof in Ziflow and verifying that it added a record in the Proof Details page.

    Smartsheet-test-proof-details-page.png

Update Smartsheet row based on proof decision update

This flow will update your Smartsheet Sheet when a decision is updated.

  1. Select the Decision update Ziflow event, configure the fields and select Next.
  2. Select Webhook Zibot.
  3. Fill out the Webhook Zibot details. This Zibot will update the Smartsheet row status with a proof decision once it is calculated in Ziflow.

    Smartsheet-update-decision-zibot.png

For updates to existing Smartsheet records, use the PATCH request type. Using PUT performs a destructive update and will overwrite the entire record, clearing any fields not included in the request.

Field Description
Request type PATCH
URL

Enter your Smartsheet URL and the Sheet ID you copied in a previous step. 

https://api.smartsheet.com/2.0/sheets/{sheet_id}/rows
Request body

Enter the JSON body referencing columns that you would like to update in Smartsheet with data from Ziflow. In this case, we are updating with Proof status from Ziflow.

Correctly reference your custom group property and property name in the JSON body. 

{$.proof.custom_properties[?(@.properties[?(@.name=='Smartsheet')])].properties[?(@.name=='Smartsheet Row ID')].value

[{"id": "{$.proof.custom_properties[?(@.properties[?(@.name=='Smartsheet')])].properties[?(@.name=='Smartsheet Row ID')].value}",
"cells":
[
{"columnId": {status_column_id}, "value": "Approved"},

]}]
Headers

Create a header:

Key: Authorization

Value: Bearer {your generated Smartsheet API key}

Enter the generated API key copied from your profile within Smartsheet.

Smartsheet apikey enetered in headers section

Select Next and Save and Turn on.

Test your flow by submitting a proof decision on a sample proof in Ziflow and then checking if the flow has passed the correct proof status in the Smartsheet row record.


Update Smartsheet row based on new proof version

This flow will update your Smartsheet Sheet when a new proof version is created.

  1. Select the New proof/version Ziflow event, configure it to trigger for a new version and select Next.
  2. Select Webhook Zibot.
  3. Fill out the Webhook Zibot details. This Zibot will update the Smartsheet row status with a proof decision once it is calculated in Ziflow.

    Smartsheet-update-proofversion-zibot.png

For updates to existing Smartsheet records, use the PATCH request type. Using PUT performs a destructive update and will overwrite the entire record, clearing any fields not included in the request.

Field Description
Request type PATCH
URL

Enter your Smartsheet URL and the Sheet ID you copied in a previous step. 

https://api.smartsheet.com/2.0/sheets/{sheet_id}/rows
Request body

Enter the JSON body referencing columns that you would like to update in Smartsheet with data from Ziflow. In this case, we are updating with Proof version and public proof link from Ziflow.

Correctly reference your custom group property and property name in the JSON body. 

{$.proof.custom_properties[?(@.properties[?(@.name=='Smartsheet')])].properties[?(@.name=='Smartsheet Row ID')].value

[{"id": "{$.proof.custom_properties[?(@.properties[?(@.name=='Smartsheet')])].properties[?(@.name=='Smartsheet Row ID')].value}",
"cells":
[
{"columnId": {version_column_id}, "value": "V {$.proof.version}"},
{"columnId": {proof_public_url_column_id}, "value": "{$.proof.public_link}"}
]}]
Headers

Create a header:

Key: Authorization

Value: Bearer {your generated Smartsheet API key}

Enter the generated API key copied from your profile within Smartsheet.

Smartsheet apikey enetered in headers section

Select Next and Save and Turn on.

Test your flow by creating a new proof version on a sample proof in Ziflow and then checking if the flow has updated the version and link in the Smartsheet row.

Update Smartsheet row with approval decision and date

This flow will update your Smartsheet Sheet when a decision is made and update the approval time (you must have the columns set up and the column IDs).

  1. Select the Decision update Ziflow event, configure the fields and select Next.
  2. Select Webhook Zibot.
  3. Fill out the Webhook Zibot details. This Zibot will update the Smartsheet row status with a proof decision once it is calculated in Ziflow.

    Smartsheet-update-decision-date-zibot.png

For updates to existing Smartsheet records, use the PATCH request type. Using PUT performs a destructive update and will overwrite the entire record, clearing any fields not included in the request.

Field Description
Request type PATCH
URL

Enter your Smartsheet URL and the Sheet ID you copied in a previous step. 

https://api.smartsheet.com/2.0/sheets/{sheet_id}/rows
Request body

Enter the JSON body referencing columns that you would like to update in Smartsheet with data from Ziflow. In this case, we are updating with Proof status and the Approval date from Ziflow.

Correctly reference your custom group property and property name in the JSON body. 

{$.proof.custom_properties[?(@.properties[?(@.name=='Smartsheet')])].properties[?(@.name=='Smartsheet Row ID')].value

[{"id": "{$.proof.custom_properties[?(@.properties[?(@.name=='Properties for integration purposes')])].properties[?(@.name=='Smartsheet Row ID')].value}", 
"cells": 
[
{"columnId": {status_column_id}, "value": "Approved"},
{"columnId": {approval_time_id}, "value": "#{$fromMillis($.trigger.proofSerializedModel.calculatedProofStatusDate)}#"}
]}]
Headers

Create a header:

Key: Authorization

Value: Bearer {your generated Smartsheet API key}

Enter the generated API key copied from your profile within Smartsheet.

Smartsheet apikey enetered in headers section

Select Next and Save and Turn on.

Test your flow by submitting a proof decision on a sample proof in Ziflow and then checking if the flow has passed the correct proof status in the Smartsheet row record.

 

Related articles

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.