Data Visualization Quickstart Guide

Generate code to graph data with Temboo

I'm programming with
Select a Language
Arduino
Texas Instruments
Samsung
C#
Java
JavaScript
Node.js
PHP
Processing
Python
REST API
Ruby
iOS
Android
Arduino Yún
+ Yún Shield
Other Arduinos
It's easy to graph data from microcontrollers and other applications for online monitoring or research. Visualize sensor data and connect to web services in minutes with code generated by Temboo.

Get Set Up

  1. If you don't already have it, install the latest version of the Arduino IDE. You should also make sure that you have the newest version of the Temboo Library by checking the Arduino Library Manager.
  2. Sign in to your Temboo account. If you don't already have one, you can register for free.
  3. Set up your Yún’s Internet connection. Arduino has a helpful guide if you need assistance.
  4. Finally, you will run a configuration sketch to prepare your Yún for sending sensor data to Temboo.

    If you're using a Yún: go to the File > Examples > Temboo > ArduinoYun menu and run the TembooDeviceConfig sketch.

    If you're using a Yún shield: go to the File > Examples > Temboo > YunShield menu and run the TembooDeviceConfig sketch.

  5. Generate Your Code

  6. Once you're logged in, go to our code generation tool and find the Gmailv2 > Messages > SendMessage Choreo. A Choreo is a cloud-based process that connects your to any web-based service, and every Temboo application is associated with at least one Choreo.
  7. Use the dropdown menu at the top of the Choreo page to select as your platform.

  8. Select either Yún or an Arduino board paired with the Yún shield as your device configuration.
  9. The first step in monitoring sensor data is to set up the sensor you wish to monitor. We provide unit converted data for specific sensor models, such as Celsius and Fahrenheit for temperature sensors. We also support unconverted data which is reported as raw values for analog data and high/low for digital.

    For this tutorial we're going to read temperature data from a Texas Instruments LMT84P. Our unit conversion formula assumes that your temperature sensor is connected to your 's 5V pin for its voltage in, and set up as specified in the sensor's data sheet.

    Using the virtual pin board on the Choreo page, select pin to set up your sensor. Select the category Temperature, then choose the Texas Instruments LMT84LP.

    Arduino Yun Temp Sensor Config
  10. Now that you've selected your sensor, Temboo will give you a choice of unit conversions—we'll use Fahrenheit.
  11. Each time you set up a sensor you'll be asked to specify the safe bounds and the caution bounds. These bounds are used to determine the color coding of the data that appears on your graph. Safe data is colored green and data near the bounds is orange. Data outside the bounds is red.

    Set the safe bounds as 40º and 45º, and the caution bounds as 5º. That's all we need to do to set up our sensor, so press Save.

  12. We will focus only on getting sensor data graphs running, so set a condition based on your sensor so that it doesn't trigger the email. Use the conditions interface to set a condition that will always be false so we don't send any emails.

    Arduino Yun Temp Trigger
  13. Next, we'll generate the code that will send our sensor data to Temboo. Scroll down and find the code box. Click the triangle next to Simple Code to open the code menu, and choose Enhanced Code.

    Hardware Screen Download Enhanced
  14. Now you will register your device. To do so, name your device and, optionally, give it a description. Specify the device location—this will allow you to view your devices on a map. For testing purposes, it's good to set a relatively short sensor interval so that you can see sensor data populate your graphs quickly. You can use the custom interval option for this. Press Save when you're done.

    Dataviz Register Device
  15. Try it Out

  16. Scroll down to find the code box on the Choreo page. Copy the code, and paste it into a new sketch in the IDE.
  17. In order to run this sketch, it needs to be configured with an appropriate TembooAccount.h header file containing your Temboo account information. Header files for certain boards will also include the device’s internet connection details.

    To create the header file, make a new tab in the IDE, and name it TembooAccount.h.

  18. Beneath the code box you previously copied from the Choreo page, you’ll find a header file. Copy the contents of the header into the TembooAccount.h tab in your IDE.
  19. The final step before running any sketch is to confirm that you've selected the appropriate board and serial port in the Arduino IDE. Go to the Tools > Board menu and select the board you're working with. Then go to Tools > Serial Port and select the port your board is connected to.
  20. Upload your code to the Yún from your IDE.
  21. Now that your code is running, open a new browser window to head over to your Devices page to see it in action. A virtual representation of your device will be waiting for you.

    Devices Dashboard
  22. Select your new device and you'll see a sensor data graph for the sensor that you set up. Over time, you'll be able to see sensor data graphs for various time periods. Additionally, at any time, you can request the latest value of your sensors. This is a handy feature for when you're between sensor intervals but want to know what's happening on your device.

    Arduino Single Device View
  23. Need help?

    We're always happy to help. Just email us at support@temboo.com, and we'll answer your questions.

    What's Next?

    Begin the
    Quickstart

    Begin
    Receive email alerts based on sensor values

    Begin
  1. If you don't already have it, install the latest version of the Arduino IDE. You should also make sure that you have the newest version of the Temboo Library by checking the Arduino Library Manager.
  2. Sign in to your Temboo account. If you don't already have one, you can register for free.
  3. Since this sketch uses a Google spreadsheet, you'll also need a Google account.
  4. Login to Google's Developer Console, and create a new Project if you haven't done so already.
  5. Under the API Manager section, select Library and make sure you've enabled API Access for the Google Sheets API.
  6. Select Credentials in the API Manager section, and create a new Client ID specifying Web application for the Application Type.
  7. When configuring the Consent Screen, make sure you fill out the Email Address and Product Name fields.
  8. Save the Consent Screen details and specify the callback URL below as the Authorized Redirect URI. Make sure to replace ACCOUNT_NAME with your Temboo account name.

    https://ACCOUNT_NAME.temboolive.com/callback/google
    
  9. Go to the Google > OAuth > InitializeOAuth Choreo page, and fill in the Client ID from the app you registered at Google and the following Scope: https://www.googleapis.com/auth/spreadsheets . Then click Generate Code to run the Choreo from our site. The InitializeOAuth Choreo will return an authorization URL and a callback ID (required for the FinalizeOAuth step).

    Google OAuth Inputs
  10. Open a new web browser, navigate to the authorization URL returned by the InitializeOAuth Choreo, and click Accept to grant the app access to your Google account.

    Google OAuth Accept
  11. Go to the Google > OAuth > FinalizeOAuth Choreo page and fill in the callback ID returned earlier by the InitializeOAuth Choreo. Then, click Generate Code to run the Choreo from our site. This process will return a Refresh Token which can be used along with the Client ID and Client Secret to authenticate with Google.
  12. Create a Google Spreadsheet. When viewing your spreadsheet, you'll see a spreadsheet ID in your browser's URL bar. Copy this ID because you'll need it when running the AppendValues Choreo. In the example below, the highlighted part is the Spreadsheet ID.

    Google Spreadsheet
  13. Generate Your Code

  14. Navigate to Google > Sheets > AppendValues in the Temboo library.
  15. Select from the drop down menu at the top of the page.

  16. Select your board and add details about its internet connection.
  17. We are logging sensor readings, so we need to set up a sensor. For this tutorial we're going to read temperature data from a Texas Instruments LMT84P.

    Using the virtual pin board on the Choreo page, select pin to set up your sensor. Select the category 'Temperature', and name your sensor.

  18. Fill in the Client ID and Client Secret you got from the Google Developer Console. Supply the Refresh Token you got from the OAuth process, then hit the Save Profile button to save a Profile for your Google account. Now you can reuse your Google Sheets authorization details on any of our Google Sheets Choreos and it will also make your code simpler and more secure.
  19. Next, fill in the SpreadsheetID from your Google Sheet's URL, and the Values you wish to send.

    The Values input should be formatted in JSON as an array of arrays.

    [
      [
        "100",
        "200",
        "300"
      ]
    ]
    

    To send a single row, you'll specify just one inner array as shown above, and each item in the inner array will represent a cell value in a row. To send multiple rows, add additional inner arrays e.g.:

    [
      [
        "100",
        "200",
        "300"
      ],
      [
        "400",
        "500",
        "600"
      ]
    ]
    
  20. Click Generate Code to test your inputs from the Temboo site, and you'll see the value "true" for the Success output in the Output section. If you check your Google Sheet, you’ll see that new values have appeared.

    Google Spreadsheets Inputs
  21. To dynamically insert sensor values into your Values JSON, use the blue sensor icon in the corner of the Values input field. Take care when inserting dynamic values into JSON.

    Inserting dynamic values into Choreo inputs
  22. Try it Out

  23. Scroll down to find the code box on the Choreo page. Copy the code, and paste it into a new sketch in the IDE.
  24. In order to run this sketch, it needs to be configured with an appropriate TembooAccount.h header file containing your Temboo account information. Header files for certain boards will also include the device’s internet connection details.

    To create the header file, make a new tab in the IDE, and name it TembooAccount.h.

  25. Beneath the code box you previously copied from the Choreo page, you’ll find a header file. Copy the contents of the header into the TembooAccount.h tab in your IDE.
  26. The final step before running any sketch is to confirm that you've selected the appropriate board and serial port in the Arduino IDE. Go to the Tools > Board menu and select the board you're working with. Then go to Tools > Serial Port and select the port your board is connected to.
  27. Save and upload your sketch to the Arduino, and open the serial monitor. After running the sketch, you'll see the response from printed to the monitor.
  28. Open your Google Sheet and you'll see that new sensor data from your has appeared.
  29. Visualize your data

  30. Clean-looking data visualization is built-in to Sheets. Just select the range of data you want to graph and select Insert > Chart to get Sheets’ recommendations on the best visualizations for your dataset.

    See the Google Sheets documentation for more information about formatting your chart.

    Conditional formatting can communicate your data at a glance. Charts aren’t the only way to visually communicate data. Setting conditional formatting rules about what the incoming data means to you can boost legibility.

    Graphs and conditional formatting in Google Sheets
  31. Need help?

    We're always happy to help. Just email us at support@temboo.com, and we'll answer your questions.

    What's Next?

    Begin the
    Quickstart

    Begin
    Receive email alerts based on sensor values

    Begin
  1. Sign in to your Temboo account. If you don't already have one, you can register for free.
  2. If this is your first time using Temboo, you'll need to set up your ARTIK board to find the Temboo libraries. To do so, you'll need to create the file temboo.conf in /etc/ld.so.conf.d. Inside of temboo.conf, you'll want to copy the line below and paste it into the file:

    /opt/iothub/artik/temboo/temboo_artik_library/lib
    
  3. After saving temboo.conf, run ldconfig from the command line to add the Temboo library directory to the system library search path.
  4. You’ll also need to get the IP address of your ARTIK board using ifconfig. The example below shows the results when the ARTIK board is connected to the internet through an ethernet cable. The IP address you'll want to use is listed next to inet.

    [root@localhost ~]$ ifconfig
    eth0: flags=4163  mtu 1500
            inet 10.11.6.200  netmask 255.255.255.0  broadcast 10.11.6.255
    
  5. Since this sketch uses a Google spreadsheet, you'll also need a Google account.
  6. Login to Google's Developer Console, and create a new Project if you haven't done so already.
  7. Under the API Manager section, select Library and make sure you've enabled API Access for the Google Sheets API.
  8. Select Credentials in the API Manager section, and create a new Client ID specifying Web application for the Application Type.
  9. When configuring the Consent Screen, make sure you fill out the Email Address and Product Name fields.
  10. Save the Consent Screen details and specify the callback URL below as the Authorized Redirect URI. Make sure to replace ACCOUNT_NAME with your Temboo account name.

    https://ACCOUNT_NAME.temboolive.com/callback/google
    
  11. Go to the Google > OAuth > InitializeOAuth Choreo page, and fill in the Client ID from the app you registered at Google and the following Scope: https://www.googleapis.com/auth/spreadsheets . Then click Generate Code to run the Choreo from our site. The InitializeOAuth Choreo will return an authorization URL and a callback ID (required for the FinalizeOAuth step).

    Google OAuth Inputs
  12. Open a new web browser, navigate to the authorization URL returned by the InitializeOAuth Choreo, and click Accept to grant the app access to your Google account.

    Google OAuth Accept
  13. Go to the Google > OAuth > FinalizeOAuth Choreo page and fill in the callback ID returned earlier by the InitializeOAuth Choreo. Then, click Generate Code to run the Choreo from our site. This process will return a Refresh Token which can be used along with the Client ID and Client Secret to authenticate with Google.
  14. Create a Google Spreadsheet. When viewing your spreadsheet, you'll see a spreadsheet ID in your browser's URL bar. Copy this ID because you'll need it when running the AppendValues Choreo. In the example below, the highlighted part is the Spreadsheet ID.

    Google Spreadsheet
  15. Generate Your Code

  16. Navigate to Google > Sheets > AppendValues in the Temboo library.
  17. Select from the drop down menu at the top of the page.

  18. We are logging sensor readings, so we need to set up a sensor. For this tutorial we're going to read temperature data from a Texas Instruments LMT84P.

    Using the virtual pin board on the Choreo page, select pin to set up your sensor. Select the category 'Temperature', and name your sensor.

  19. Fill in the Client ID and Client Secret you got from the Google Developer Console. Supply the Refresh Token you got from the OAuth process, then hit the Save Profile button to save a Profile for your Google account. Now you can reuse your Google Sheets authorization details on any of our Google Sheets Choreos and it will also make your code simpler and more secure.
  20. Next, fill in the SpreadsheetID from your Google Sheet's URL, and the Values you wish to send.

    The Values input should be formatted in JSON as an array of arrays.

    [
      [
        "100",
        "200",
        "300"
      ]
    ]
    

    To send a single row, you'll specify just one inner array as shown above, and each item in the inner array will represent a cell value in a row. To send multiple rows, add additional inner arrays e.g.:

    [
      [
        "100",
        "200",
        "300"
      ],
      [
        "400",
        "500",
        "600"
      ]
    ]
    
  21. Click Generate Code to test your inputs from the Temboo site, and you'll see the value "true" for the Success output in the Output section. If you check your Google Sheet, you’ll see that new values have appeared.

    Google Spreadsheets Inputs
  22. To dynamically insert sensor values into your Values JSON, use the blue sensor icon in the corner of the Values input field. Take care when inserting dynamic values into JSON.

    Inserting dynamic values into Choreo inputs
  23. Download the generated code to your computer by clicking Download source code to the right of the code.

    Getting generated ARTIK code
  24. Try it Out

  25. Copy the downloaded zip file to your ARTIK board using scp. From your computer, go to the directory where the zip file is located and type the command below. Make sure you use the IP address for your board you found using ifconfig.

    [root@localhost ~]$ scp .zip root@xxx.xxx.xxx.xxx:/home
    
  26. From the ARTIK command line (either through a serial terminal or ssh session), change your current directory to /home. Next, unzip the generated code you just copied over. You can unzip the file by using the command below:

    [root@localhost ~]$ unzip .zip
    
  27. Now go to the directory and compile and run your code using the commands below. Run the first command to compile your code. After compiling has finished and no errors have been reported, run your program using the second command. After running the program, you should see the response from in your console.

    [root@localhost ~]$ gcc -L/opt/iothub/artik/temboo/temboo_artik_library/lib -ltemboo -I/opt/iothub/artik/temboo/temboo_artik_library/include s.c -o 
    [root@localhost ~]$ ./
    

    Note: If you get an error about cdefs.h not being found, this could mean your ARTIK board was not shipped with glibc-headers. This can be solved by reinstalling glibc-headers using the command below. After reinstalling glibc-headers, run the two commands above to compile and run your code.

    [root@localhost ~]$ yum reinstall glibc-headers
    
  28. Open your Google Sheet and you'll see that new sensor data from your has appeared.
  29. Visualize your data

  30. Clean-looking data visualization is built-in to Sheets. Just select the range of data you want to graph and select Insert > Chart to get Sheets’ recommendations on the best visualizations for your dataset.

    See the Google Sheets documentation for more information about formatting your chart.

    Conditional formatting can communicate your data at a glance. Charts aren’t the only way to visually communicate data. Setting conditional formatting rules about what the incoming data means to you can boost legibility.

    Graphs and conditional formatting in Google Sheets
  31. Need help?

    We're always happy to help. Just email us at support@temboo.com, and we'll answer your questions.

    What's Next?

    Begin the
    Quickstart

    Begin
    Receive email alerts based on sensor values

    Begin
  1. Download and install the latest version of the Energia IDE if you don't already have it.
  2. Sign in to your Temboo account. If you don't already have one, you can register for free.
  3. Since this sketch uses a Google spreadsheet, you'll also need a Google account.
  4. Login to Google's Developer Console, and create a new Project if you haven't done so already.
  5. Under the API Manager section, select Library and make sure you've enabled API Access for the Google Sheets API.
  6. Select Credentials in the API Manager section, and create a new Client ID specifying Web application for the Application Type.
  7. When configuring the Consent Screen, make sure you fill out the Email Address and Product Name fields.
  8. Save the Consent Screen details and specify the callback URL below as the Authorized Redirect URI. Make sure to replace ACCOUNT_NAME with your Temboo account name.

    https://ACCOUNT_NAME.temboolive.com/callback/google
    
  9. Go to the Google > OAuth > InitializeOAuth Choreo page, and fill in the Client ID from the app you registered at Google and the following Scope: https://www.googleapis.com/auth/spreadsheets . Then click Generate Code to run the Choreo from our site. The InitializeOAuth Choreo will return an authorization URL and a callback ID (required for the FinalizeOAuth step).

    Google OAuth Inputs
  10. Open a new web browser, navigate to the authorization URL returned by the InitializeOAuth Choreo, and click Accept to grant the app access to your Google account.

    Google OAuth Accept
  11. Go to the Google > OAuth > FinalizeOAuth Choreo page and fill in the callback ID returned earlier by the InitializeOAuth Choreo. Then, click Generate Code to run the Choreo from our site. This process will return a Refresh Token which can be used along with the Client ID and Client Secret to authenticate with Google.
  12. Create a Google Spreadsheet. When viewing your spreadsheet, you'll see a spreadsheet ID in your browser's URL bar. Copy this ID because you'll need it when running the AppendValues Choreo. In the example below, the highlighted part is the Spreadsheet ID.

    Google Spreadsheet
  13. Generate Your Code

  14. Navigate to Google > Sheets > AppendValues in the Temboo library.
  15. Select from the drop down menu at the top of the page.

  16. Select your board and add details about its internet connection.
  17. We are logging sensor readings, so we need to set up a sensor. For this tutorial we're going to read temperature data from a Texas Instruments LMT84P.

    Using the virtual pin board on the Choreo page, select pin to set up your sensor. Select the category 'Temperature', and name your sensor.

  18. Fill in the Client ID and Client Secret you got from the Google Developer Console. Supply the Refresh Token you got from the OAuth process, then hit the Save Profile button to save a Profile for your Google account. Now you can reuse your Google Sheets authorization details on any of our Google Sheets Choreos and it will also make your code simpler and more secure.
  19. Next, fill in the SpreadsheetID from your Google Sheet's URL, and the Values you wish to send.

    The Values input should be formatted in JSON as an array of arrays.

    [
      [
        "100",
        "200",
        "300"
      ]
    ]
    

    To send a single row, you'll specify just one inner array as shown above, and each item in the inner array will represent a cell value in a row. To send multiple rows, add additional inner arrays e.g.:

    [
      [
        "100",
        "200",
        "300"
      ],
      [
        "400",
        "500",
        "600"
      ]
    ]
    
  20. Click Generate Code to test your inputs from the Temboo site, and you'll see the value "true" for the Success output in the Output section. If you check your Google Sheet, you’ll see that new values have appeared.

    Google Spreadsheets Inputs
  21. To dynamically insert sensor values into your Values JSON, use the blue sensor icon in the corner of the Values input field. Take care when inserting dynamic values into JSON.

    Inserting dynamic values into Choreo inputs
  22. Try it Out

  23. Scroll down to find the code box on the Choreo page. Copy the code, and paste it into a new sketch in the IDE.
  24. In order to run this sketch, it needs to be configured with an appropriate TembooAccount.h header file containing your Temboo account information. Header files for certain boards will also include the device’s internet connection details.

    To create the header file, make a new tab in the IDE, and name it TembooAccount.h.

  25. Beneath the code box you previously copied from the Choreo page, you’ll find a header file. Copy the contents of the header into the TembooAccount.h tab in your IDE.
  26. The final step before running any sketch is to confirm that you've selected the appropriate board and serial port in Energia. Go to the Tools > Board menu and select the LaunchPad you're working with. Then go to Tools > Serial Port and select the port your board is connected to.

    selecting your board in Energia
  27. With both files in place you are ready to upload the sketch to the LaunchPad. After running the sketch, open the Serial Monitor and you'll see the response from .
  28. Open your Google Sheet and you'll see that new sensor data from your has appeared.
  29. Visualize your data

  30. Clean-looking data visualization is built-in to Sheets. Just select the range of data you want to graph and select Insert > Chart to get Sheets’ recommendations on the best visualizations for your dataset.

    See the Google Sheets documentation for more information about formatting your chart.

    Conditional formatting can communicate your data at a glance. Charts aren’t the only way to visually communicate data. Setting conditional formatting rules about what the incoming data means to you can boost legibility.

    Graphs and conditional formatting in Google Sheets
  31. Need help?

    We're always happy to help. Just email us at support@temboo.com, and we'll answer your questions.

    What's Next?

    Begin the
    Quickstart

    Begin
    Receive email alerts based on sensor values

    Begin
  1. You'll need a free Texas Instruments account to use their online IDE, CCS Cloud. You can sign up here.
  2. If you haven't already done so, prepare your board for making secure connections by following our Setting up CC3220 for SSL tutorial.
  3. Sign in to your Temboo account. If you don't already have one, you can register for free.
  4. Generate Your Code

  5. Once you're logged in, go to our code generation tool and find the Gmailv2 > Messages > SendMessage Choreo. A Choreo is a cloud-based process that connects your to any web-based service, and every Temboo application is associated with at least one Choreo.
  6. Use the dropdown menu at the top of the Choreo page to select as your platform.

  7. Select your board and add details about its internet connection.
  8. The first step in monitoring sensor data is to set up the sensor you wish to monitor. We provide unit converted data for specific sensor models, such as Celsius and Fahrenheit for temperature sensors. We also support unconverted data which is reported as raw values for analog data and high/low for digital.

    For this tutorial we're going to read temperature data from a Texas Instruments LMT84P. Our unit conversion formula assumes that your temperature sensor is connected to your 's 5V pin for its voltage in, and set up as specified in the sensor's data sheet.

    Using the virtual pin board on the Choreo page, select pin to set up your sensor. Select the category Temperature, then choose the Texas Instruments LMT84LP.

    Texas Instruments temperature sensor configuration
  9. Now that you've selected your sensor, Temboo will give you a choice of unit conversions—we'll use Fahrenheit.
  10. Each time you set up a sensor you'll be asked to specify the safe bounds and the caution bounds. These bounds are used to determine the color coding of the data that appears on your graph. Safe data is colored green and data near the bounds is orange. Data outside the bounds is red.

    Set the safe bounds as 40º and 45º, and the caution bounds as 5º. That's all we need to do to set up our sensor, so press Save.

  11. We will focus only on getting sensor data graphs running, so set a condition based on your sensor so that it doesn't trigger the email. Use the conditions interface to set a condition that will always be false so we don't send any emails.

    Setting the sensor to avoid triggering the Choreo
  12. Next, we'll generate the code that will send our sensor data to Temboo. Scroll down and find the code box. Click the triangle next to Simple Code to open the code menu, and choose Enhanced Code.

    Hardware Screen Download Enhanced
  13. Now you will register your device. To do so, name your device and, optionally, give it a description. Specify the device location—this will allow you to view your devices on a map. For testing purposes, it's good to set a relatively short sensor interval so that you can see sensor data populate your graphs quickly. You can use the custom interval option for this. Press Save when you're done.

    Dataviz Register Device
  14. Try it Out

  15. Scroll down to the code box of the Choreo page. Click Send to CCS Cloud to the right of your generated code. Name your application and click Send. Click the link that appears to visit the CCS Cloud IDE in your browser.

    Sending your code to CCS Cloud
  16. Plug your CC3220 board into your computer via USB. Select its USB connection in CCS Cloud via the Target > Connect COM port... menu.
  17. Run the code on your CC3220 from CCS Cloud. After running the code, open the Serial Monitor and you'll see the response from the Choreo.

    Running your code on CCS Cloud

  18. Now that your code is running, open a new browser window to head over to your Devices page to see it in action. A virtual representation of your device will be waiting for you.

    Devices Dashboard
  19. Select your new device and you'll see a sensor data graph for the sensor that you set up. Over time, you'll be able to see sensor data graphs for various time periods. Additionally, at any time, you can request the latest value of your sensors. This is a handy feature for when you're between sensor intervals but want to know what's happening on your device.

    Arduino Single Device View
  20. Need help?

    We're always happy to help. Just email us at support@temboo.com, and we'll answer your questions.

    What's Next?

    Begin the
    Quickstart

    Begin
    Receive email alerts based on sensor values

    Begin
  1. For this tutorial you will need Android 1.6 (or later) and an Android code editor. We've used Android Studio 0.4.6 for this tutorial, but they will work equally well in whatever IDE you are using.
  2. Sign in to your Temboo account. If you don't already have one, you can register for free.
  3. Create a new project in Android Studio.
    1. In the New Project dialog, name the application "Temboo Test" (or whatever you like), uncheck Create custom launcher icon, and click Next.
    2. Select Blank Activity, click Next.
    3. Leave the Activity Name and other settings as-is and click Finish.
  4. Download and extract the Temboo Android SDK.
  5. Add the Temboo SDK to your project:
    1. Find the core SDK .jar file (e.g. temboo-android-sdk-core-2.19.0.jar) in the Temboo SDK folder you just downloaded and extracted.
    2. Right-click and copy the .jar file, return to Android Studio, and right-click/paste the .jar into the libs folder of your project
    3. Right-click on the .jar and select Add as Library. Click OK on the dialog that's displayed.

    You've now added the core Temboo SDK to your project. Repeat the above steps to add the application bundle (e.g. -2.19.0.jar) from the Temboo SDK folder you just extracted, which will allow us to use APIs.

    Prepare your Android application

    We'll now make some adjustments to the default application that Android Studio has generated for us.

  6. Open the Android manifest located at app/src/main/res/AndroidManifest.xml. In order to access the internet, you will need to add <uses-permission android:name="android.permission.INTERNET"/> below the <application> tag.
  7. The default layout of the application included a TextView that we'll make use of, but before we can do so we need to give it an identifier. Locate and double-click on the fileapp > src > main > res > layout > activity_main.xml. This file describes the layout of our MainActivity class.
  8. Click on the "Hello World" text in the device emulator to select the TextView.
  9. In the Properties panel on the bottom-right of the editor, find the id property. Click to the right of it and enter @+id/response
  10. Next, locate the text property and delete the default "Hello World" value (we'll fill this in programmatically later).
  11. Since this sketch uses a Google spreadsheet, you'll also need a Google account.
  12. Login to Google's Developer Console, and create a new Project if you haven't done so already.
  13. Under the API Manager section, select Library and make sure you've enabled API Access for the Google Sheets API.
  14. Select Credentials in the API Manager section, and create a new Client ID specifying Web application for the Application Type.
  15. When configuring the Consent Screen, make sure you fill out the Email Address and Product Name fields.
  16. Save the Consent Screen details and specify the callback URL below as the Authorized Redirect URI. Make sure to replace ACCOUNT_NAME with your Temboo account name.

    https://ACCOUNT_NAME.temboolive.com/callback/google
    
  17. Go to the Google > OAuth > InitializeOAuth Choreo page, and fill in the Client ID from the app you registered at Google and the following Scope: https://www.googleapis.com/auth/spreadsheets . Then click Generate Code to run the Choreo from our site. The InitializeOAuth Choreo will return an authorization URL and a callback ID (required for the FinalizeOAuth step).

    Google OAuth Inputs
  18. Open a new web browser, navigate to the authorization URL returned by the InitializeOAuth Choreo, and click Accept to grant the app access to your Google account.

    Google OAuth Accept
  19. Go to the Google > OAuth > FinalizeOAuth Choreo page and fill in the callback ID returned earlier by the InitializeOAuth Choreo. Then, click Generate Code to run the Choreo from our site. This process will return a Refresh Token which can be used along with the Client ID and Client Secret to authenticate with Google.
  20. Create a Google Spreadsheet. When viewing your spreadsheet, you'll see a spreadsheet ID in your browser's URL bar. Copy this ID because you'll need it when running the AppendValues Choreo. In the example below, the highlighted part is the Spreadsheet ID.

    Google Spreadsheet
  21. Generate Your Code

  22. Navigate to Google > Sheets > AppendValues in the Temboo library.
  23. Select from the drop down menu at the top of the page.

  24. Fill in the Client ID and Client Secret you got from the Google Developer Console. Supply the Refresh Token you got from the OAuth process, then hit the Save Profile button to save a Profile for your Google account. Now you can reuse your Google Sheets authorization details on any of our Google Sheets Choreos and it will also make your code simpler and more secure.
  25. Next, fill in the SpreadsheetID from your Google Sheet's URL, and the Values you wish to send.

    The Values input should be formatted in JSON as an array of arrays.

    [
      [
        "100",
        "200",
        "300"
      ]
    ]
    

    To send a single row, you'll specify just one inner array as shown above, and each item in the inner array will represent a cell value in a row. To send multiple rows, add additional inner arrays e.g.:

    [
      [
        "100",
        "200",
        "300"
      ],
      [
        "400",
        "500",
        "600"
      ]
    ]
    
  26. Click Generate Code to test your inputs from the Temboo site, and you'll see the value "true" for the Success output in the Output section. If you check your Google Sheet, you’ll see that new values have appeared.

    Google Spreadsheets Inputs
  27. Scroll down to the code box on the Choreo page to find the generated code.
  28. Because network operations block the main thread execution, we'll need to make our calls to Temboo using AsyncTask. Create a new class that extends AsyncTask called SheetsTask (or whatever you like), adding the @Override implementations for doInBackground and onProcessComplete:

    package com.temboo.android.gettingstarted.app;
    
    import android.os.AsyncTask;
    import android.util.Log;
    import android.widget.TextView;
    
    /**
     * An AsyncTask that will be used to interact with Temboo
     */
    class SheetsTask extends AsyncTask<Void, Void, String> {
    
        private TextView textView;
    
        public SheetsTask(TextView textView){
            this.textView = textView;
        }
    
        @Override
        protected String doInBackground(Void... arg0) {
            try {
                // Temboo code will go here
            } catch(Exception e) {
                // if an exception occurred, log it
                Log.e(this.getClass().toString(), e.getMessage());
            }
            return null;
        }
    
        protected void onPostExecute(String result) {
            try {
                // Will update UI here
            } catch(Exception e) {
                // if an exception occurred, show an error message
                Log.e(this.getClass().toString(), e.getMessage());
            }
        }
    }
    
  29. Notice that we've added a constructor that takes a TextView as an argument. This will reference the TextView we set up earlier.
  30. Now that our AsyncTask is set up, copy the generated code snippet from the Temboo website and paste it into the doInBackground method of your AsyncTask class. We'll also add the required imports to create a AppendValues Choreo, AppendValuesInputSet, and AppendValuesResultSet:

    import com.temboo.Library.Google.Sheets.AppendValues;
    import com.temboo.Library.Google.Sheets.AppendValues.AppendValuesInputSet;
    import com.temboo.Library.Google.Sheets.AppendValues.AppendValuesResultSet;
    import com.temboo.core.TembooSession;
    
  31. Print the Results

    Each Choreo in the Android SDK returns a ResultSet subclass that contains get methods tailored specifically to the outputs of that Choreo. Using the ResultSet, you can retrieve the raw data (typically XML or JSON) returned by a third-party API or relevant fields that we've parsed out of the response for you.

    To update the UI with the API response returned by the Choreo, do the following:

  32. Add the following code at the bottom of the try block of the doInBackground method in your class:

    return appendValues.get_Response() ;
  33. The return value we've just added is passed by Android as an argument to the onPostExecute method, we'll update the UI there:

        protected void onPostExecute(String result) {
            try {
                // Update the UI
                textView.setText(result);
            } catch(Exception e) {
                // if an exception occurred, show an error message
                Log.e(this.getClass().toString(), e.getMessage());
            }
        }
    
  34. Try it Out

  35. In order to see your new task in action, you will need to invoke it from the MainActivity class created with your project. The simplest way to do this is to add a call to it in the onCreate method, which should end up looking like this:

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        TextView textView = (TextView) findViewById(R.id.response);
        new SheetsTask(textView).execute();
    }
    
  36. In order to post dynamic values to your sheet from your Android application, you'll need to build a String object to pass as input to the AppendValues Choreo. Create a String object containing properly formatted JSON in your code that includes any variables you wish to post to your sheet and name it customValueSet or whatever you like, then pass it to appendValuesInputs.set_Values() like so:

    appendValuesInputs.set_Values(customValueSet);
    
  37. Deploy and run the application. After a moment, you'll see the API response in the UI.
  38. Open your Google Sheet and you'll see that new data sent from your application has appeared.
  39. Visualize your data

  40. Clean-looking data visualization is built-in to Sheets. Just select the range of data you want to graph and select Insert > Chart to get Sheets’ recommendations on the best visualizations for your dataset.

    See the Google Sheets documentation for more information about formatting your chart.

    Conditional formatting can communicate your data at a glance. Charts aren’t the only way to visually communicate data. Setting conditional formatting rules about what the incoming data means to you can boost legibility.

    Graphs and conditional formatting in Google Sheets
  41. Need help?

    We're always happy to help. Just email us at support@temboo.com, and we'll answer your questions.

    What's Next?

    Try out some of our other tutorials.
  1. For this tutorial, you will need the .NET 4.5 framework and Microsoft Visual Studio 2013 (or later) installed.
  2. Sign in to your Temboo account. If you don't already have one, you can register for free.
  3. In Visual Studio, create a new C# Console Application project. For this example, name it TembooTest. The new project should automatically include a C# class file called Program.cs containing a Main method.
  4. Download the Temboo C# SDK and extract the ZIP file into the directory where you keep your Visual Studio projects.
  5. In Visual Studio, right-click the References folder under TembooTest and select Add Reference. In the dialogue box that appears, click Browse and select TembooSDK.dll located in the bin folder within the extracted Temboo SDK directory. Click OK.
  6. Since this sketch uses a Google spreadsheet, you'll also need a Google account.
  7. Login to Google's Developer Console, and create a new Project if you haven't done so already.
  8. Under the API Manager section, select Library and make sure you've enabled API Access for the Google Sheets API.
  9. Select Credentials in the API Manager section, and create a new Client ID specifying Web application for the Application Type.
  10. When configuring the Consent Screen, make sure you fill out the Email Address and Product Name fields.
  11. Save the Consent Screen details and specify the callback URL below as the Authorized Redirect URI. Make sure to replace ACCOUNT_NAME with your Temboo account name.

    https://ACCOUNT_NAME.temboolive.com/callback/google
    
  12. Go to the Google > OAuth > InitializeOAuth Choreo page, and fill in the Client ID from the app you registered at Google and the following Scope: https://www.googleapis.com/auth/spreadsheets . Then click Generate Code to run the Choreo from our site. The InitializeOAuth Choreo will return an authorization URL and a callback ID (required for the FinalizeOAuth step).

    Google OAuth Inputs
  13. Open a new web browser, navigate to the authorization URL returned by the InitializeOAuth Choreo, and click Accept to grant the app access to your Google account.

    Google OAuth Accept
  14. Go to the Google > OAuth > FinalizeOAuth Choreo page and fill in the callback ID returned earlier by the InitializeOAuth Choreo. Then, click Generate Code to run the Choreo from our site. This process will return a Refresh Token which can be used along with the Client ID and Client Secret to authenticate with Google.
  15. Create a Google Spreadsheet. When viewing your spreadsheet, you'll see a spreadsheet ID in your browser's URL bar. Copy this ID because you'll need it when running the AppendValues Choreo. In the example below, the highlighted part is the Spreadsheet ID.

    Google Spreadsheet
  16. Generate Your Code

  17. Navigate to Google > Sheets > AppendValues in the Temboo library.
  18. Select from the drop down menu at the top of the page.

  19. Fill in the Client ID and Client Secret you got from the Google Developer Console. Supply the Refresh Token you got from the OAuth process, then hit the Save Profile button to save a Profile for your Google account. Now you can reuse your Google Sheets authorization details on any of our Google Sheets Choreos and it will also make your code simpler and more secure.
  20. Next, fill in the SpreadsheetID from your Google Sheet's URL, and the Values you wish to send.

    The Values input should be formatted in JSON as an array of arrays.

    [
      [
        "100",
        "200",
        "300"
      ]
    ]
    

    To send a single row, you'll specify just one inner array as shown above, and each item in the inner array will represent a cell value in a row. To send multiple rows, add additional inner arrays e.g.:

    [
      [
        "100",
        "200",
        "300"
      ],
      [
        "400",
        "500",
        "600"
      ]
    ]
    
  21. Click Generate Code to test your inputs from the Temboo site, and you'll see the value "true" for the Success output in the Output section. If you check your Google Sheet, you’ll see that new values have appeared.

    Google Spreadsheets Inputs
  22. Try it Out

  23. Scroll down to the code box on the Choreo page to find the generated code.
  24. Copy the code snippet, and replace the contents of Program.cs with the copied code.
  25. In order to post dynamic values to your sheet from your C# application, you'll need to build a JSON string to pass as input to the AppendValues Choreo. Create a properly formatted JSON string in your code that includes any variables you wish to post to your sheet and name it customValueSet or whatever you like, then edit appendValuesChoreo.setValues(), passing in customValueSet like so:

    appendValuesChoreo.setValues(customValueSet);
    
  26. Open your Google Sheet and you'll see that new data sent from your application has appeared.
  27. Visualize your data

  28. Clean-looking data visualization is built-in to Sheets. Just select the range of data you want to graph and select Insert > Chart to get Sheets’ recommendations on the best visualizations for your dataset.

    See the Google Sheets documentation for more information about formatting your chart.

    Conditional formatting can communicate your data at a glance. Charts aren’t the only way to visually communicate data. Setting conditional formatting rules about what the incoming data means to you can boost legibility.

    Graphs and conditional formatting in Google Sheets
  29. Need help?

    We're always happy to help. Just email us at support@temboo.com, and we'll answer your questions.

    What's Next?

    Try out some of our other tutorials.
  1. For this tutorial, you will need the iOS 7 SDK and Xcode 6.
  2. Sign in to your Temboo account. If you don't already have one, you can register for free.
  3. For simplicity's sake, we'll create a command line tool that will print its results to the Xcode console. For an example of using Temboo with a UI-based application (as you would on an iPhone or iPad) check out our Facebook OAuth example.
  4. Create a new Xcode project: OS X > Application > Command Line Tool.
  5. Name it TembooTest, select Objective-C as the Language, and click Next (the other fields are optional and may be left blank) to save your new project.
  6. Download and extract the Temboo iOS SDK, noting where it's been saved.
  7. Click on the folder that contains your project's code (it should be called TembooTest and contain a file called main.m), then select Add Files to TembooTest from the File menu. Browse to where you saved the Temboo SDK, locate and click on the core folder inside the SDK src folder. Make sure that Copy items if needed is unchecked and Create groups is selected, and then click Add.
  8. Repeat the above steps to add the TMB.h and TMB.m files located in the SDk's src/library folder.
  9. Since this sketch uses a Google spreadsheet, you'll also need a Google account.
  10. Login to Google's Developer Console, and create a new Project if you haven't done so already.
  11. Under the API Manager section, select Library and make sure you've enabled API Access for the Google Sheets API.
  12. Select Credentials in the API Manager section, and create a new Client ID specifying Web application for the Application Type.
  13. When configuring the Consent Screen, make sure you fill out the Email Address and Product Name fields.
  14. Save the Consent Screen details and specify the callback URL below as the Authorized Redirect URI. Make sure to replace ACCOUNT_NAME with your Temboo account name.

    https://ACCOUNT_NAME.temboolive.com/callback/google
    
  15. Go to the Google > OAuth > InitializeOAuth Choreo page, and fill in the Client ID from the app you registered at Google and the following Scope: https://www.googleapis.com/auth/spreadsheets . Then click Generate Code to run the Choreo from our site. The InitializeOAuth Choreo will return an authorization URL and a callback ID (required for the FinalizeOAuth step).

    Google OAuth Inputs
  16. Open a new web browser, navigate to the authorization URL returned by the InitializeOAuth Choreo, and click Accept to grant the app access to your Google account.

    Google OAuth Accept
  17. Go to the Google > OAuth > FinalizeOAuth Choreo page and fill in the callback ID returned earlier by the InitializeOAuth Choreo. Then, click Generate Code to run the Choreo from our site. This process will return a Refresh Token which can be used along with the Client ID and Client Secret to authenticate with Google.
  18. Create a Google Spreadsheet. When viewing your spreadsheet, you'll see a spreadsheet ID in your browser's URL bar. Copy this ID because you'll need it when running the AppendValues Choreo. In the example below, the highlighted part is the Spreadsheet ID.

    Google Spreadsheet
  19. Generate Your Code

  20. Navigate to Google > Sheets > AppendValues in the Temboo library.
  21. Select from the drop down menu at the top of the page.

  22. Fill in the Client ID and Client Secret you got from the Google Developer Console. Supply the Refresh Token you got from the OAuth process, then hit the Save Profile button to save a Profile for your Google account. Now you can reuse your Google Sheets authorization details on any of our Google Sheets Choreos and it will also make your code simpler and more secure.
  23. Next, fill in the SpreadsheetID from your Google Sheet's URL, and the Values you wish to send.

    The Values input should be formatted in JSON as an array of arrays.

    [
      [
        "100",
        "200",
        "300"
      ]
    ]
    

    To send a single row, you'll specify just one inner array as shown above, and each item in the inner array will represent a cell value in a row. To send multiple rows, add additional inner arrays e.g.:

    [
      [
        "100",
        "200",
        "300"
      ],
      [
        "400",
        "500",
        "600"
      ]
    ]
    
  24. Click Generate Code to test your inputs from the Temboo site, and you'll see the value "true" for the Success output in the Output section. If you check your Google Sheet, you’ll see that new values have appeared.

    Google Spreadsheets Inputs
  25. Scroll down to find the Code section of the Library page.
  26. Copy the code snippet and paste it into your project's main.m file, below the import statement for <Foundation/Foundation.h> and above the main method.
  27. Finally, update the main method in main.m with the code below so that your file calls the AppendValues Choreo:

    int main(int argc, const char * argv[]) {
    
        @autoreleasepool {
    		// Create a new instance of our class
    		AppendValues *tutorial = [[AppendValues alloc] init];
            
    		// Run it
    		[tutorial runAppendValuesChoreo];
            
    		// Only needed for command line tools, this simply keeps the program from exiting immediately
    		[[NSRunLoop currentRunLoop] run];
    	}
        return 0;
    }
    
  28. In order to post dynamic values to your sheet from your iOS application, you'll need to build a JSON string to pass as input to the AppendValues Choreo. Create a properly formatted JSON string in your code that includes any variables you wish to post to your sheet and name it customValueSet or whatever you like, then edit appendValuesInputs setValues, passing in customValueSet like so:

    [appendValuesInputs setValues:customValueSet];
    
  29. Try It Out

    Each Choreo in the iOS SDK returns a ResultSet subclass that contains get methods tailored specifically to the outputs of that Choreo. Using the ResultSet, you can retrieve the raw data (typically XML or JSON) returned by a third-party API or relevant fields that we've parsed out of the response for you. Our snippets include code to print out the results returned by the Choreo in question.

  30. Run the code and you will see the full response from the Google Sheets API.
  31. Open your Google Sheet and you'll see that new data sent from your application has appeared.
  32. Visualize your data

  33. Clean-looking data visualization is built-in to Sheets. Just select the range of data you want to graph and select Insert > Chart to get Sheets’ recommendations on the best visualizations for your dataset.

    See the Google Sheets documentation for more information about formatting your chart.

    Conditional formatting can communicate your data at a glance. Charts aren’t the only way to visually communicate data. Setting conditional formatting rules about what the incoming data means to you can boost legibility.

    Graphs and conditional formatting in Google Sheets
  34. Need help?

    We're always happy to help. Just email us at support@temboo.com, and we'll answer your questions.

    What's Next?

    Try out some of our other tutorials.
  1. For this tutorial you will need Java 1.6 (or later) and a Java code editor. We've used Eclipse for these tutorials, but they will work equally well in whatever IDE you are using.
  2. Sign in to your Temboo account. If you don't already have one, you can register for free.
  3. Create a new Java project in Eclipse and add a folder called /libs.
  4. Download the Temboo Java SDK.
  5. Copy the downloaded JAR into the /libs folder. Refresh the project, then right-click the JAR file and select: Build Path > Add to Build Path.
  6. Add a new Java class containing a main method to your project. You can call it whatever you like.
  7. Since this sketch uses a Google spreadsheet, you'll also need a Google account.
  8. Login to Google's Developer Console, and create a new Project if you haven't done so already.
  9. Under the API Manager section, select Library and make sure you've enabled API Access for the Google Sheets API.
  10. Select Credentials in the API Manager section, and create a new Client ID specifying Web application for the Application Type.
  11. When configuring the Consent Screen, make sure you fill out the Email Address and Product Name fields.
  12. Save the Consent Screen details and specify the callback URL below as the Authorized Redirect URI. Make sure to replace ACCOUNT_NAME with your Temboo account name.

    https://ACCOUNT_NAME.temboolive.com/callback/google
    
  13. Go to the Google > OAuth > InitializeOAuth Choreo page, and fill in the Client ID from the app you registered at Google and the following Scope: https://www.googleapis.com/auth/spreadsheets . Then click Generate Code to run the Choreo from our site. The InitializeOAuth Choreo will return an authorization URL and a callback ID (required for the FinalizeOAuth step).

    Google OAuth Inputs
  14. Open a new web browser, navigate to the authorization URL returned by the InitializeOAuth Choreo, and click Accept to grant the app access to your Google account.

    Google OAuth Accept
  15. Go to the Google > OAuth > FinalizeOAuth Choreo page and fill in the callback ID returned earlier by the InitializeOAuth Choreo. Then, click Generate Code to run the Choreo from our site. This process will return a Refresh Token which can be used along with the Client ID and Client Secret to authenticate with Google.
  16. Create a Google Spreadsheet. When viewing your spreadsheet, you'll see a spreadsheet ID in your browser's URL bar. Copy this ID because you'll need it when running the AppendValues Choreo. In the example below, the highlighted part is the Spreadsheet ID.

    Google Spreadsheet
  17. Generate Your Code

  18. Navigate to Google > Sheets > AppendValues in the Temboo library.
  19. Select from the drop down menu at the top of the page.

  20. Fill in the Client ID and Client Secret you got from the Google Developer Console. Supply the Refresh Token you got from the OAuth process, then hit the Save Profile button to save a Profile for your Google account. Now you can reuse your Google Sheets authorization details on any of our Google Sheets Choreos and it will also make your code simpler and more secure.
  21. Next, fill in the SpreadsheetID from your Google Sheet's URL, and the Values you wish to send.

    The Values input should be formatted in JSON as an array of arrays.

    [
      [
        "100",
        "200",
        "300"
      ]
    ]
    

    To send a single row, you'll specify just one inner array as shown above, and each item in the inner array will represent a cell value in a row. To send multiple rows, add additional inner arrays e.g.:

    [
      [
        "100",
        "200",
        "300"
      ],
      [
        "400",
        "500",
        "600"
      ]
    ]
    
  22. Click Generate Code to test your inputs from the Temboo site, and you'll see the value "true" for the Success output in the Output section. If you check your Google Sheet, you’ll see that new values have appeared.

    Google Spreadsheets Inputs
  23. Scroll down to the code box on the Choreo page, then copy and paste the code into the main method of your Java class. Press Cmd+Shift+O (or Ctrl+Shift+O in Windows) to automatically import dependencies. Note: your main method should declare that it throws Exception.
  24. Import dependencies again, making sure to select the Temboo packages.
  25. Try It Out

  26. In order to post dynamic values to your sheet from your Java application, you'll need to build a JSON string to pass as input to the AppendValues Choreo. Create a properly formatted JSON string in your code that includes any variables you wish to post to your sheet and name it customValueSet or whatever you like, then edit appendValuesInputs.set_Values(), passing in customValueSet like so:

    appendValuesInputs.set_Values(customValueSet);
    
  27. Run the code to post data from your Java application to Google Sheets.
  28. Open your Google Sheet and you'll see that new data sent from your application has appeared.
  29. Visualize your data

  30. Clean-looking data visualization is built-in to Sheets. Just select the range of data you want to graph and select Insert > Chart to get Sheets’ recommendations on the best visualizations for your dataset.

    See the Google Sheets documentation for more information about formatting your chart.

    Conditional formatting can communicate your data at a glance. Charts aren’t the only way to visually communicate data. Setting conditional formatting rules about what the incoming data means to you can boost legibility.

    Graphs and conditional formatting in Google Sheets
  31. Need help?

    We're always happy to help. Just email us at support@temboo.com, and we'll answer your questions.

    What's Next?

    Try out some of our other tutorials.
  1. When using the Temboo JavaScript SDK, you’ll need a proxy in a server-side language and a web application server. A proxy communicates with a server, since JavaScript only runs on the client side. In this tutorial we'll be using PHP, but you can use any of these server-side languages with web application server.
  2. Sign in to your Temboo account. If you don't already have one, you can register for free.
  3. Create a new .html file and save it as temboo-example.html into a folder where you'll save the rest of your project files.
  4. Create a new .php file and save it as proxy-server.php into the same project folder as your temboo-example.html file.
  5. Download the latest Temboo JavaScript SDK and unzip the file.
  6. Change the name of the resulting folder to js-sdk and move it into the same folder as your temboo-example.html file.
  7. Download the latest Temboo PHP SDK and unzip the file.
  8. Change the name of the resulting folder to php-sdk and move it into the same folder as your temboo-example.html file. Your project folder should look similar to the screenshot below:

  9. Since this sketch uses a Google spreadsheet, you'll also need a Google account.
  10. Login to Google's Developer Console, and create a new Project if you haven't done so already.
  11. Under the API Manager section, select Library and make sure you've enabled API Access for the Google Sheets API.
  12. Select Credentials in the API Manager section, and create a new Client ID specifying Web application for the Application Type.
  13. When configuring the Consent Screen, make sure you fill out the Email Address and Product Name fields.
  14. Save the Consent Screen details and specify the callback URL below as the Authorized Redirect URI. Make sure to replace ACCOUNT_NAME with your Temboo account name.

    https://ACCOUNT_NAME.temboolive.com/callback/google
    
  15. Go to the Google > OAuth > InitializeOAuth Choreo page, and fill in the Client ID from the app you registered at Google and the following Scope: https://www.googleapis.com/auth/spreadsheets . Then click Generate Code to run the Choreo from our site. The InitializeOAuth Choreo will return an authorization URL and a callback ID (required for the FinalizeOAuth step).

    Google OAuth Inputs
  16. Open a new web browser, navigate to the authorization URL returned by the InitializeOAuth Choreo, and click Accept to grant the app access to your Google account.

    Google OAuth Accept
  17. Go to the Google > OAuth > FinalizeOAuth Choreo page and fill in the callback ID returned earlier by the InitializeOAuth Choreo. Then, click Generate Code to run the Choreo from our site. This process will return a Refresh Token which can be used along with the Client ID and Client Secret to authenticate with Google.
  18. Create a Google Spreadsheet. When viewing your spreadsheet, you'll see a spreadsheet ID in your browser's URL bar. Copy this ID because you'll need it when running the AppendValues Choreo. In the example below, the highlighted part is the Spreadsheet ID.

    Google Spreadsheet
  19. Generate Your Code

  20. Navigate to Google > Sheets > AppendValues in the Temboo library.
  21. Select from the drop down menu at the top of the page.

  22. Fill in the Client ID and Client Secret you got from the Google Developer Console. Supply the Refresh Token you got from the OAuth process, then hit the Save Profile button to save a Profile for your Google account. Now you can reuse your Google Sheets authorization details on any of our Google Sheets Choreos and it will also make your code simpler and more secure.
  23. Next, fill in the SpreadsheetID from your Google Sheet's URL, and the Values you wish to send.

    The Values input should be formatted in JSON as an array of arrays.

    [
      [
        "100",
        "200",
        "300"
      ]
    ]
    

    To send a single row, you'll specify just one inner array as shown above, and each item in the inner array will represent a cell value in a row. To send multiple rows, add additional inner arrays e.g.:

    [
      [
        "100",
        "200",
        "300"
      ],
      [
        "400",
        "500",
        "600"
      ]
    ]
    
  24. Click Generate Code to test your inputs from the Temboo site, and you'll see the value "true" for the Success output in the Output section. If you check your Google Sheet, you’ll see that new values have appeared.

    Google Spreadsheets Inputs
  25. Scroll down to the Code section of the Choreo page. Copy the JavaScript code snippet and paste it into your temboo-example.html file.
  26. In your temboo-example.html file, make sure that your script source points to the correct location of the temboo.js SDK file.

    <script src="js-sdk/js/temboo.js"></script>
    
  27. In the same file, we'll also want to confirm that the location of our proxy is correctly specified. Our server is proxy-server.php.

    // Instantiate the client proxy with the URI of your server proxy
    var temboo = new TembooProxy('proxy-server.php');
    
  28. Back on the Choreo page, scroll down to the Proxy Code snippet and select PHP or another server-side proxy language from the Proxy Code Language dropdown menu. Copy the proxy code snippet and paste it into your proxy-server.php file.

  29. In the same .php file, make sure that the line points to the correct location of the php-sdk SDK folder that you downloaded earlier.

    require 'php-sdk/src/temboo.php';
    
  30. Try It Out

  31. In order to post dynamic values to your sheet from your web application, you'll need to build a JSON string to pass as input to the AppendValues Choreo. Create a properly formatted JSON string in your code that includes any variables you wish to post to your sheet and name it customValueSet or whatever you like, then edit appendValuesChoreo.setInput(), passing in customValueSet like so:

    appendValuesChoreo.setInput('Values', customValueSet);
    
  32. Run the PHP server. For instance, if you're running the code using a web host, you can upload your project folder to your site via FTP client. If you're using Apache for PHP to run a local server, you'd run the following command from Terminal:

    sudo apachectl start
    
  33. Go to temboo-example.html in the browser at the url where you're server is running. For instance, if you're running the PHP server locally:

    127.0.0.1/projectFolderName/temboo-example.html
    
  34. Take a look at the developer console and you'll see the full response from the Google Sheets API.
  35. Open your Google Sheet and you'll see that new data sent from your application has appeared.
  36. Visualize your data

  37. Clean-looking data visualization is built-in to Sheets. Just select the range of data you want to graph and select Insert > Chart to get Sheets’ recommendations on the best visualizations for your dataset.

    See the Google Sheets documentation for more information about formatting your chart.

    Conditional formatting can communicate your data at a glance. Charts aren’t the only way to visually communicate data. Setting conditional formatting rules about what the incoming data means to you can boost legibility.

    Graphs and conditional formatting in Google Sheets
  38. Need help?

    We're always happy to help. Just email us at support@temboo.com, and we'll answer your questions.

    What's Next?

    Try out some of our other tutorials.
  1. Install Node.js v0.8.0 (or later) on your system if you don't already have it.
  2. Sign in to your Temboo account. If you don't already have one, you can register for free.
  3. Create a new .js file wherever you would like to build this Node.js sample project. In this example, we'll call the file tembootest.js, though you can call it whatever you like.
  4. Download the Temboo Node.js SDK and extract it.
  5. The SDK is in a directory called node_modules in accordance with the convention established by the Node Package Manager. Move the node_modules folder to the same directory as your new .js project file.
  6. Since this sketch uses a Google spreadsheet, you'll also need a Google account.
  7. Login to Google's Developer Console, and create a new Project if you haven't done so already.
  8. Under the API Manager section, select Library and make sure you've enabled API Access for the Google Sheets API.
  9. Select Credentials in the API Manager section, and create a new Client ID specifying Web application for the Application Type.
  10. When configuring the Consent Screen, make sure you fill out the Email Address and Product Name fields.
  11. Save the Consent Screen details and specify the callback URL below as the Authorized Redirect URI. Make sure to replace ACCOUNT_NAME with your Temboo account name.

    https://ACCOUNT_NAME.temboolive.com/callback/google
    
  12. Go to the Google > OAuth > InitializeOAuth Choreo page, and fill in the Client ID from the app you registered at Google and the following Scope: https://www.googleapis.com/auth/spreadsheets . Then click Generate Code to run the Choreo from our site. The InitializeOAuth Choreo will return an authorization URL and a callback ID (required for the FinalizeOAuth step).

    Google OAuth Inputs
  13. Open a new web browser, navigate to the authorization URL returned by the InitializeOAuth Choreo, and click Accept to grant the app access to your Google account.

    Google OAuth Accept
  14. Go to the Google > OAuth > FinalizeOAuth Choreo page and fill in the callback ID returned earlier by the InitializeOAuth Choreo. Then, click Generate Code to run the Choreo from our site. This process will return a Refresh Token which can be used along with the Client ID and Client Secret to authenticate with Google.
  15. Create a Google Spreadsheet. When viewing your spreadsheet, you'll see a spreadsheet ID in your browser's URL bar. Copy this ID because you'll need it when running the AppendValues Choreo. In the example below, the highlighted part is the Spreadsheet ID.

    Google Spreadsheet
  16. Generate Your Code

  17. Navigate to Google > Sheets > AppendValues in the Temboo library.
  18. Select from the drop down menu at the top of the page.

  19. Fill in the Client ID and Client Secret you got from the Google Developer Console. Supply the Refresh Token you got from the OAuth process, then hit the Save Profile button to save a Profile for your Google account. Now you can reuse your Google Sheets authorization details on any of our Google Sheets Choreos and it will also make your code simpler and more secure.
  20. Next, fill in the SpreadsheetID from your Google Sheet's URL, and the Values you wish to send.

    The Values input should be formatted in JSON as an array of arrays.

    [
      [
        "100",
        "200",
        "300"
      ]
    ]
    

    To send a single row, you'll specify just one inner array as shown above, and each item in the inner array will represent a cell value in a row. To send multiple rows, add additional inner arrays e.g.:

    [
      [
        "100",
        "200",
        "300"
      ],
      [
        "400",
        "500",
        "600"
      ]
    ]
    
  21. Click Generate Code to test your inputs from the Temboo site, and you'll see the value "true" for the Success output in the Output section. If you check your Google Sheet, you’ll see that new values have appeared.

    Google Spreadsheets Inputs
  22. Scroll down to find the Code section of the Choreo page.
  23. Copy the code snippet and paste it into your tembootest.js file.
  24. Make sure that all of your import statements are included. Both of the following lines should be present and uncommented in your code.

    var tsession = require("temboo/core/temboosession");
    var Google = require("temboo/Library/Google/Sheets");
    
  25. In order to post dynamic values to your sheet from your Node.js application, you'll need to build a JSON string to pass as input to the AppendValues Choreo. Create a properly formatted JSON string in your code that includes any variables you wish to post to your sheet and name it customValueSet or whatever you like, then edit appendValuesInputs.set_Values(), passing in customValueSet like so:

    appendValuesInputs.set_Values(customValueSet);
    
  26. Try It Out

  27. Now you're ready to run the script to post values to Google Sheets. Here's the command you need to run if you're executing this from the command line. Otherwise just run it from your IDE.

    node tembootest.js
  28. Open your Google Sheet and you'll see that new data sent from your application has appeared.
  29. Visualize your data

  30. Clean-looking data visualization is built-in to Sheets. Just select the range of data you want to graph and select Insert > Chart to get Sheets’ recommendations on the best visualizations for your dataset.

    See the Google Sheets documentation for more information about formatting your chart.

    Conditional formatting can communicate your data at a glance. Charts aren’t the only way to visually communicate data. Setting conditional formatting rules about what the incoming data means to you can boost legibility.

    Graphs and conditional formatting in Google Sheets
  31. Need help?

    We're always happy to help. Just email us at support@temboo.com, and we'll answer your questions.

    What's Next?

    Try out some of our other tutorials.
  1. Be sure that you have PHP 5 (or later) and a PHP code editor. We've used Sublime Text for our tutorials but they will work equally well in whatever IDE you are using.
  2. Sign in to your Temboo account. If you don't already have one, you can register for free.
  3. Create a new PHP file in your preferred editor.
  4. Download the Temboo PHP SDK.
  5. Unzip the downloaded SDK and move the resulting php-sdk folder into the same parent folder as your new, blank PHP file.

  6. Add the Temboo PHP SDK to your script:

    require 'php-sdk/src/temboo.php';
  7. Since this sketch uses a Google spreadsheet, you'll also need a Google account.
  8. Login to Google's Developer Console, and create a new Project if you haven't done so already.
  9. Under the API Manager section, select Library and make sure you've enabled API Access for the Google Sheets API.
  10. Select Credentials in the API Manager section, and create a new Client ID specifying Web application for the Application Type.
  11. When configuring the Consent Screen, make sure you fill out the Email Address and Product Name fields.
  12. Save the Consent Screen details and specify the callback URL below as the Authorized Redirect URI. Make sure to replace ACCOUNT_NAME with your Temboo account name.

    https://ACCOUNT_NAME.temboolive.com/callback/google
    
  13. Go to the Google > OAuth > InitializeOAuth Choreo page, and fill in the Client ID from the app you registered at Google and the following Scope: https://www.googleapis.com/auth/spreadsheets . Then click Generate Code to run the Choreo from our site. The InitializeOAuth Choreo will return an authorization URL and a callback ID (required for the FinalizeOAuth step).

    Google OAuth Inputs
  14. Open a new web browser, navigate to the authorization URL returned by the InitializeOAuth Choreo, and click Accept to grant the app access to your Google account.

    Google OAuth Accept
  15. Go to the Google > OAuth > FinalizeOAuth Choreo page and fill in the callback ID returned earlier by the InitializeOAuth Choreo. Then, click Generate Code to run the Choreo from our site. This process will return a Refresh Token which can be used along with the Client ID and Client Secret to authenticate with Google.
  16. Create a Google Spreadsheet. When viewing your spreadsheet, you'll see a spreadsheet ID in your browser's URL bar. Copy this ID because you'll need it when running the AppendValues Choreo. In the example below, the highlighted part is the Spreadsheet ID.

    Google Spreadsheet
  17. Generate Your Code

  18. Navigate to Google > Sheets > AppendValues in the Temboo library.
  19. Select from the drop down menu at the top of the page.

  20. Fill in the Client ID and Client Secret you got from the Google Developer Console. Supply the Refresh Token you got from the OAuth process, then hit the Save Profile button to save a Profile for your Google account. Now you can reuse your Google Sheets authorization details on any of our Google Sheets Choreos and it will also make your code simpler and more secure.
  21. Next, fill in the SpreadsheetID from your Google Sheet's URL, and the Values you wish to send.

    The Values input should be formatted in JSON as an array of arrays.

    [
      [
        "100",
        "200",
        "300"
      ]
    ]
    

    To send a single row, you'll specify just one inner array as shown above, and each item in the inner array will represent a cell value in a row. To send multiple rows, add additional inner arrays e.g.:

    [
      [
        "100",
        "200",
        "300"
      ],
      [
        "400",
        "500",
        "600"
      ]
    ]
    
  22. Click Generate Code to test your inputs from the Temboo site, and you'll see the value "true" for the Success output in the Output section. If you check your Google Sheet, you’ll see that new values have appeared.

    Google Spreadsheets Inputs
  23. Try it Out

  24. Scroll down to the code box on the Choreo page to find the generated code.
  25. Copy the code snippet and paste it into your PHP script.
  26. In order to post dynamic values to your sheet from your PHP application, you'll need to build a JSON string to pass as input to the AppendValues Choreo. Create a properly formatted JSON string in your code that includes any variables you wish to post to your sheet and name it customValueSet or whatever you like, then edit $appendValuesInputs->setValues(), passing in customValueSet like so:

    $appendValuesInputs->setValues($customValueSet);
    
  27. Run the code to post values to your Google Sheet from your PHP application.
  28. Open your Google Sheet and you'll see that new data sent from your application has appeared.
  29. Visualize your data

  30. Clean-looking data visualization is built-in to Sheets. Just select the range of data you want to graph and select Insert > Chart to get Sheets’ recommendations on the best visualizations for your dataset.

    See the Google Sheets documentation for more information about formatting your chart.

    Conditional formatting can communicate your data at a glance. Charts aren’t the only way to visually communicate data. Setting conditional formatting rules about what the incoming data means to you can boost legibility.

    Graphs and conditional formatting in Google Sheets
  31. Need help?

    We're always happy to help. Just email us at support@temboo.com, and we'll answer your questions.

    What's Next?

    Try out some of our other tutorials.
  1. If you don't already have it, download and install the latest version of Processing.
  2. Sign in to your Temboo account. If you don't already have one, you can register for free.
  3. Download the Temboo Library for Processing. Unzip the file and put the temboo folder into your Documents/Processing/libraries/ folder (or My Documents/Processing/libraries/ on a PC). If Processing is currently open, restart it so that it will recognize the Temboo library that you just added.
  4. Since this sketch uses a Google spreadsheet, you'll also need a Google account.
  5. Login to Google's Developer Console, and create a new Project if you haven't done so already.
  6. Under the API Manager section, select Library and make sure you've enabled API Access for the Google Sheets API.
  7. Select Credentials in the API Manager section, and create a new Client ID specifying Web application for the Application Type.
  8. When configuring the Consent Screen, make sure you fill out the Email Address and Product Name fields.
  9. Save the Consent Screen details and specify the callback URL below as the Authorized Redirect URI. Make sure to replace ACCOUNT_NAME with your Temboo account name.

    https://ACCOUNT_NAME.temboolive.com/callback/google
    
  10. Go to the Google > OAuth > InitializeOAuth Choreo page, and fill in the Client ID from the app you registered at Google and the following Scope: https://www.googleapis.com/auth/spreadsheets . Then click Generate Code to run the Choreo from our site. The InitializeOAuth Choreo will return an authorization URL and a callback ID (required for the FinalizeOAuth step).

    Google OAuth Inputs
  11. Open a new web browser, navigate to the authorization URL returned by the InitializeOAuth Choreo, and click Accept to grant the app access to your Google account.

    Google OAuth Accept
  12. Go to the Google > OAuth > FinalizeOAuth Choreo page and fill in the callback ID returned earlier by the InitializeOAuth Choreo. Then, click Generate Code to run the Choreo from our site. This process will return a Refresh Token which can be used along with the Client ID and Client Secret to authenticate with Google.
  13. Create a Google Spreadsheet. When viewing your spreadsheet, you'll see a spreadsheet ID in your browser's URL bar. Copy this ID because you'll need it when running the AppendValues Choreo. In the example below, the highlighted part is the Spreadsheet ID.

    Google Spreadsheet
  14. Generate Your Code

  15. Navigate to Google > Sheets > AppendValues in the Temboo library.
  16. Select from the drop down menu at the top of the page.

  17. Fill in the Client ID and Client Secret you got from the Google Developer Console. Supply the Refresh Token you got from the OAuth process, then hit the Save Profile button to save a Profile for your Google account. Now you can reuse your Google Sheets authorization details on any of our Google Sheets Choreos and it will also make your code simpler and more secure.
  18. Next, fill in the SpreadsheetID from your Google Sheet's URL, and the Values you wish to send.

    The Values input should be formatted in JSON as an array of arrays.

    [
      [
        "100",
        "200",
        "300"
      ]
    ]
    

    To send a single row, you'll specify just one inner array as shown above, and each item in the inner array will represent a cell value in a row. To send multiple rows, add additional inner arrays e.g.:

    [
      [
        "100",
        "200",
        "300"
      ],
      [
        "400",
        "500",
        "600"
      ]
    ]
    
  19. Click Generate Code to test your inputs from the Temboo site, and you'll see the value "true" for the Success output in the Output section. If you check your Google Sheet, you’ll see that new values have appeared.

    Google Spreadsheets Inputs
  20. Scroll down to the code box on the Choreo page to find the generated code. Copy the code, and paste it into a new sketch in the Processing editor.
  21. In order to run this sketch, your Temboo account name and application details must be included in the TembooSession, like so:

    When you're logged in, this information is automatically populated in your generated sketch. Remember to remove your account details if you share your sketch.

  22. Try it Out

  23. In order to post dynamic values to your sheet from your Processing sketch, you'll need to build a JSON string to pass as input to the AppendValues Choreo. Create a properly formatted JSON string in your code that includes any variables you wish to post to your sheet and name it customValueSet or whatever you like, then edit appendValuesChoreo.setValues(), passing in customValueSet like so:

    appendValuesChoreo.setValues(customValueSet);
    
  24. Run the sketch from Processing to post data to your Google Sheet.
  25. Open your Google Sheet and you'll see that new data sent from your application has appeared.
  26. Visualize your data

  27. Clean-looking data visualization is built-in to Sheets. Just select the range of data you want to graph and select Insert > Chart to get Sheets’ recommendations on the best visualizations for your dataset.

    See the Google Sheets documentation for more information about formatting your chart.

    Conditional formatting can communicate your data at a glance. Charts aren’t the only way to visually communicate data. Setting conditional formatting rules about what the incoming data means to you can boost legibility.

    Graphs and conditional formatting in Google Sheets
  28. Need help?

    We're always happy to help. Just email us at support@temboo.com, and we'll answer your questions.

    What's Next?

    Try out some of our other tutorials.
  1. Make sure that Python 2.6 (or later) is installed on your system.
  2. Sign in to your Temboo account. If you don't already have one, you can register for free.
  3. Create a new .py file the directory where you'd like to build this Python sample project. In this example, we'll call the file TembooTest.py, though you can call it whatever you like.
  4. Download the Temboo Python SDK and extract the ZIP file to the same directory as your new .py file.
  5. Since this sketch uses a Google spreadsheet, you'll also need a Google account.
  6. Login to Google's Developer Console, and create a new Project if you haven't done so already.
  7. Under the API Manager section, select Library and make sure you've enabled API Access for the Google Sheets API.
  8. Select Credentials in the API Manager section, and create a new Client ID specifying Web application for the Application Type.
  9. When configuring the Consent Screen, make sure you fill out the Email Address and Product Name fields.
  10. Save the Consent Screen details and specify the callback URL below as the Authorized Redirect URI. Make sure to replace ACCOUNT_NAME with your Temboo account name.

    https://ACCOUNT_NAME.temboolive.com/callback/google
    
  11. Go to the Google > OAuth > InitializeOAuth Choreo page, and fill in the Client ID from the app you registered at Google and the following Scope: https://www.googleapis.com/auth/spreadsheets . Then click Generate Code to run the Choreo from our site. The InitializeOAuth Choreo will return an authorization URL and a callback ID (required for the FinalizeOAuth step).

    Google OAuth Inputs
  12. Open a new web browser, navigate to the authorization URL returned by the InitializeOAuth Choreo, and click Accept to grant the app access to your Google account.

    Google OAuth Accept
  13. Go to the Google > OAuth > FinalizeOAuth Choreo page and fill in the callback ID returned earlier by the InitializeOAuth Choreo. Then, click Generate Code to run the Choreo from our site. This process will return a Refresh Token which can be used along with the Client ID and Client Secret to authenticate with Google.
  14. Create a Google Spreadsheet. When viewing your spreadsheet, you'll see a spreadsheet ID in your browser's URL bar. Copy this ID because you'll need it when running the AppendValues Choreo. In the example below, the highlighted part is the Spreadsheet ID.

    Google Spreadsheet
  15. Generate Your Code

  16. Navigate to Google > Sheets > AppendValues in the Temboo library.
  17. Select from the drop down menu at the top of the page.

  18. Fill in the Client ID and Client Secret you got from the Google Developer Console. Supply the Refresh Token you got from the OAuth process, then hit the Save Profile button to save a Profile for your Google account. Now you can reuse your Google Sheets authorization details on any of our Google Sheets Choreos and it will also make your code simpler and more secure.
  19. Next, fill in the SpreadsheetID from your Google Sheet's URL, and the Values you wish to send.

    The Values input should be formatted in JSON as an array of arrays.

    [
      [
        "100",
        "200",
        "300"
      ]
    ]
    

    To send a single row, you'll specify just one inner array as shown above, and each item in the inner array will represent a cell value in a row. To send multiple rows, add additional inner arrays e.g.:

    [
      [
        "100",
        "200",
        "300"
      ],
      [
        "400",
        "500",
        "600"
      ]
    ]
    
  20. Click Generate Code to test your inputs from the Temboo site, and you'll see the value "true" for the Success output in the Output section. If you check your Google Sheet, you’ll see that new values have appeared.

    Google Spreadsheets Inputs
  21. Scroll down to the code box on the Choreo page to find the generated code.
  22. Copy the code snippet and paste it into your TembooTest.py file.
  23. In order to post dynamic values to your sheet from your Python script, you'll need to build a JSON string to pass as input to the AppendValues Choreo. Create a properly formatted JSON string in your code that includes any variables you wish to post to your sheet and name it custom_value_set or whatever you like, then edit appendValuesInputs.set_Values(), passing in custom_value_set like so:

    appendValuesInputs.set_Values(custom_value_set)
    
  24. Try it Out

  25. Now you're ready to run the script and post the data to your Google Sheet. Here's the command you need to run if you're executing this from the command line. Otherwise just run it from your IDE.

    python TembooTest.py
    
  26. Open your Google Sheet and you'll see that new data sent from your application has appeared.
  27. Visualize your data

  28. Clean-looking data visualization is built-in to Sheets. Just select the range of data you want to graph and select Insert > Chart to get Sheets’ recommendations on the best visualizations for your dataset.

    See the Google Sheets documentation for more information about formatting your chart.

    Conditional formatting can communicate your data at a glance. Charts aren’t the only way to visually communicate data. Setting conditional formatting rules about what the incoming data means to you can boost legibility.

    Graphs and conditional formatting in Google Sheets
  29. Need help?

    We're always happy to help. Just email us at support@temboo.com, and we'll answer your questions.

    What's Next?

    Try out some of our other tutorials.
  1. To follow this tutorial, you will need Ruby 1.9 (or later) and a Ruby code editor installed on your system.
  2. Sign in to your Temboo account. If you don't already have one, you can register for free.
  3. Create a new Ruby project somewhere in your filesystem.
  4. Add a new Ruby script to your project. You can call it whatever you like.
  5. Download the Temboo Ruby SDK.
  6. In a terminal window, navigate to the location of your downloaded SDK. Type gem install temboo-ruby-sdk-x.gem, where x is the version number. You will now be able to access Temboo's Ruby SDK in your code.
  7. Since this sketch uses a Google spreadsheet, you'll also need a Google account.
  8. Login to Google's Developer Console, and create a new Project if you haven't done so already.
  9. Under the API Manager section, select Library and make sure you've enabled API Access for the Google Sheets API.
  10. Select Credentials in the API Manager section, and create a new Client ID specifying Web application for the Application Type.
  11. When configuring the Consent Screen, make sure you fill out the Email Address and Product Name fields.
  12. Save the Consent Screen details and specify the callback URL below as the Authorized Redirect URI. Make sure to replace ACCOUNT_NAME with your Temboo account name.

    https://ACCOUNT_NAME.temboolive.com/callback/google
    
  13. Go to the Google > OAuth > InitializeOAuth Choreo page, and fill in the Client ID from the app you registered at Google and the following Scope: https://www.googleapis.com/auth/spreadsheets . Then click Generate Code to run the Choreo from our site. The InitializeOAuth Choreo will return an authorization URL and a callback ID (required for the FinalizeOAuth step).

    Google OAuth Inputs
  14. Open a new web browser, navigate to the authorization URL returned by the InitializeOAuth Choreo, and click Accept to grant the app access to your Google account.

    Google OAuth Accept
  15. Go to the Google > OAuth > FinalizeOAuth Choreo page and fill in the callback ID returned earlier by the InitializeOAuth Choreo. Then, click Generate Code to run the Choreo from our site. This process will return a Refresh Token which can be used along with the Client ID and Client Secret to authenticate with Google.
  16. Create a Google Spreadsheet. When viewing your spreadsheet, you'll see a spreadsheet ID in your browser's URL bar. Copy this ID because you'll need it when running the AppendValues Choreo. In the example below, the highlighted part is the Spreadsheet ID.

    Google Spreadsheet
  17. Generate Your Code

  18. Navigate to Google > Sheets > AppendValues in the Temboo library.
  19. Select from the drop down menu at the top of the page.

  20. Fill in the Client ID and Client Secret you got from the Google Developer Console. Supply the Refresh Token you got from the OAuth process, then hit the Save Profile button to save a Profile for your Google account. Now you can reuse your Google Sheets authorization details on any of our Google Sheets Choreos and it will also make your code simpler and more secure.
  21. Next, fill in the SpreadsheetID from your Google Sheet's URL, and the Values you wish to send.

    The Values input should be formatted in JSON as an array of arrays.

    [
      [
        "100",
        "200",
        "300"
      ]
    ]
    

    To send a single row, you'll specify just one inner array as shown above, and each item in the inner array will represent a cell value in a row. To send multiple rows, add additional inner arrays e.g.:

    [
      [
        "100",
        "200",
        "300"
      ],
      [
        "400",
        "500",
        "600"
      ]
    ]
    
  22. Click Generate Code to test your inputs from the Temboo site, and you'll see the value "true" for the Success output in the Output section. If you check your Google Sheet, you’ll see that new values have appeared.

    Google Spreadsheets Inputs
  23. Try it Out

  24. Scroll down to the code box on the Choreo page to find the generated code.
  25. Copy the code snippet and paste it into your Ruby script.
  26. Make sure your imports are in place at the top of the file. They should look like the sample below.

    require "temboo"
    require "Library/Google"
    
  27. In order to post dynamic values to your Sheet from your Ruby application, you'll need to build a JSON string to pass as input to the AppendValues Choreo. Create a properly formatted JSON string in your code that includes any variables you wish to post to your sheet and name it customValueSet or whatever you like, then edit appendValuesInputs.set_Values(), passing in customValueSet like so:

    appendValuesInputs.set_Values(customValueSet);
    
  28. Run the code to send data from your Ruby application.
  29. Open your Google Sheet and you'll see that new data sent from your application has appeared.
  30. Visualize your data

  31. Clean-looking data visualization is built-in to Sheets. Just select the range of data you want to graph and select Insert > Chart to get Sheets’ recommendations on the best visualizations for your dataset.

    See the Google Sheets documentation for more information about formatting your chart.

    Conditional formatting can communicate your data at a glance. Charts aren’t the only way to visually communicate data. Setting conditional formatting rules about what the incoming data means to you can boost legibility.

    Graphs and conditional formatting in Google Sheets
  32. Need help?

    We're always happy to help. Just email us at support@temboo.com, and we'll answer your questions.

    What's Next?

    Try out some of our other tutorials.
  1. Sign in to your Temboo account. If you don't already have one, you can register for free.
  2. Since this sketch uses a Google spreadsheet, you'll also need a Google account.
  3. Login to Google's Developer Console, and create a new Project if you haven't done so already.
  4. Under the API Manager section, select Library and make sure you've enabled API Access for the Google Sheets API.
  5. Select Credentials in the API Manager section, and create a new Client ID specifying Web application for the Application Type.
  6. When configuring the Consent Screen, make sure you fill out the Email Address and Product Name fields.
  7. Save the Consent Screen details and specify the callback URL below as the Authorized Redirect URI. Make sure to replace ACCOUNT_NAME with your Temboo account name.

    https://ACCOUNT_NAME.temboolive.com/callback/google
    
  8. Go to the Google > OAuth > InitializeOAuth Choreo page, and fill in the Client ID from the app you registered at Google and the following Scope: https://www.googleapis.com/auth/spreadsheets . Then click Generate Code to run the Choreo from our site. The InitializeOAuth Choreo will return an authorization URL and a callback ID (required for the FinalizeOAuth step).

    Google OAuth Inputs
  9. Open a new web browser, navigate to the authorization URL returned by the InitializeOAuth Choreo, and click Accept to grant the app access to your Google account.

    Google OAuth Accept
  10. Go to the Google > OAuth > FinalizeOAuth Choreo page and fill in the callback ID returned earlier by the InitializeOAuth Choreo. Then, click Generate Code to run the Choreo from our site. This process will return a Refresh Token which can be used along with the Client ID and Client Secret to authenticate with Google.
  11. Create a Google Spreadsheet. When viewing your spreadsheet, you'll see a spreadsheet ID in your browser's URL bar. Copy this ID because you'll need it when running the AppendValues Choreo. In the example below, the highlighted part is the Spreadsheet ID.

    Google Spreadsheet
  12. Generate Your Code

  13. Navigate to Google > Sheets > AppendValues in the Temboo library.
  14. Select from the drop down menu at the top of the page.

  15. Fill in the Client ID and Client Secret you got from the Google Developer Console. Supply the Refresh Token you got from the OAuth process, then hit the Save Profile button to save a Profile for your Google account. Now you can reuse your Google Sheets authorization details on any of our Google Sheets Choreos and it will also make your code simpler and more secure.
  16. Next, fill in the SpreadsheetID from your Google Sheet's URL, and the Values you wish to send.

    The Values input should be formatted in JSON as an array of arrays.

    [
      [
        "100",
        "200",
        "300"
      ]
    ]
    

    To send a single row, you'll specify just one inner array as shown above, and each item in the inner array will represent a cell value in a row. To send multiple rows, add additional inner arrays e.g.:

    [
      [
        "100",
        "200",
        "300"
      ],
      [
        "400",
        "500",
        "600"
      ]
    ]
    
  17. Click Generate Code to test your inputs from the Temboo site, and you'll see the value "true" for the Success output in the Output section. If you check your Google Sheet, you’ll see that new values have appeared.

    Google Spreadsheets Inputs
  18. Try it Out

  19. Scroll down to the code box on the Choreo page to find the generated code.
  20. Now you're ready to run the script. Copy and paste the cURL script into your terminal or console and run it.
  21. Open your Google Sheet and you'll see that new data sent straight from your Terminal has appeared.
  22. Visualize your data

  23. Clean-looking data visualization is built-in to Sheets. Just select the range of data you want to graph and select Insert > Chart to get Sheets’ recommendations on the best visualizations for your dataset.

    See the Google Sheets documentation for more information about formatting your chart.

    Conditional formatting can communicate your data at a glance. Charts aren’t the only way to visually communicate data. Setting conditional formatting rules about what the incoming data means to you can boost legibility.

    Graphs and conditional formatting in Google Sheets
  24. Need help?

    We're always happy to help. Just email us at support@temboo.com, and we'll answer your questions.

    What's Next?

    Try out some of our other tutorials.