Ruby
Connect to Repull from Ruby using net/http.
1
Prerequisites
Ruby 3.0+ installed on your machine.
You also need a Repull API key. Get one from your dashboard.
2
Install
gem install repull
3
Set up environment variables
Add your credentials to a .env file in your project root:
REPULL_API_KEY=sk_test_YOUR_KEY REPULL_WORKSPACE_ID=YOUR_WORKSPACE_ID
Start with sk_test_ keys for sandbox data. Switch to sk_live_ when you are ready for production.
4
Make your first API call
Configure the client with your API key, then call any endpoint. The example below lists properties and fetches reservations.
require 'net/http'
require 'json'
uri = URI('https://api.repull.dev/v1/properties')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer #{ENV['REPULL_API_KEY']}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http|
http.request(req)
}
properties = JSON.parse(res.body)
puts "Found #{properties['data'].length} properties"5
Next steps
You are all set. Explore the rest of the platform:
AI