Create spreadsheets & documents with Ruby
Create a shareable spreadsheet from Ruby using only the standard library — no gems, no Google API setup. POST your rows as JSON with net/http and get back a URL. This works in plain Ruby scripts, Rails controllers, and Sidekiq background jobs.
require "net/http"
require "json"
uri = URI("https://openofficeai.com/api/v1/sheets")
res = Net::HTTP.post(
uri,
{
title: "Q3 Revenue",
sheets: [{ rows: [
["Month", "Revenue", "Growth"],
["July", 48200, "+12%"],
] }],
}.to_json,
"Authorization" => "Bearer YOUR_API_KEY",
"Content-Type" => "application/json",
)
puts JSON.parse(res.body)["url"]How to create a spreadsheet with Ruby
- 1Copy your API key from the dashboard.
- 2POST a JSON body to /api/v1/sheets with Net::HTTP and your Bearer token.
- 3Parse the response and read the url field.
- 4In Rails, wrap this in a Sidekiq/ActiveJob worker to generate sheets off the request cycle.
Why use OpenOfficeAI with Ruby
- Standard library only — no gems to add or audit.
- Fits Rails apps, rake tasks, and background jobs.
- Turn model data into a shareable report in a few lines.
Frequently asked questions
Do I need a gem like rubyXL or caxlsx?
No. You send JSON and OpenOfficeAI builds the file. For an .xlsx download, hit /api/v1/download/{id}?format=xlsx after creating the sheet — no spreadsheet gem required.
How do I run this in a Rails background job?
Move the Net::HTTP call into an ActiveJob/Sidekiq worker, pass the rows as arguments, and store the returned url on your record so the link is ready when the user needs it.
Can I update the sheet later from Ruby?
Yes. GET /api/v1/sheets/{id} to fetch the data, modify it in Ruby, then PUT it back to /api/v1/sheets/{id}. The shareable URL stays the same.
Start creating documents with Ruby
Free tier includes 500 API calls per month — no card required.