rweb-scrapingtidyversehttrsmartsheet-api

Connect R to Smartsheet via API?


I am looking to connect to "scrape" a SmartSheet file that was shared with me and retrieve the results from a table. From there I want to convert the table to a data frame.

How would I connect to Smartsheets API? Is it using HTTP or REST? How would I convert the retrived data into a data frame?


Solution

  • I have created a small but extensible API client R library for smartsheet: https://github.com/cole-johanson/smartsheetr.

    For the above request, make sure to follow the README, then use:

    library(smartsheetr)
    library(dplyr)
    
    sheet_name_of_interest = '<sheet name>'
    your_sheets = ss_get_sheets()
    sheet_id_of_interest = your_sheets |> filter(name == sheet_name_of_interest) |> pull(id)
    ss_read_sheet(sheet_id_of_interest)