Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (16 sloc) 532 Bytes
require 'faraday'
require 'json'
# Required API Variables
domain = 'your_domain'
email = 'your_email_address'
api_key = 'your_api_key'
site_id = 'your_site_id'
# URL and Path
url = "https://#{domain}"
path = "/api/v1/sites.json"
# New connection with base URL and path
conn = url) # New connection with base URL
conn.basic_auth(email, api_key) # Set the authentication header
response = conn.get(path) # GET API request
# Do what you need with the data
results = JSON.parse(response.body)
You can’t perform that action at this time.