Ruby Examples

Complete Ruby integration examples

Installation

gem install httparty

Basic Usage

require 'httparty'

def generate_pdf
  api_key = ENV['SPEEDSTEIN_API_KEY']
  response = HTTParty.post(
    'https://api.speedstein.com/v1/pdf/generate',
    headers: { 'Authorization' => "Bearer #{api_key}" },
    body: {
      html: '<html><body><h1>Hello PDF!</h1></body></html>',
      options: { format: 'A4' }
    }.to_json
  )
  puts "PDF generated: #{response['download_url']}"
end

generate_pdf