Get Accounts

Can be filtered. Returns a Collection of AccountResponse objects

require 'uri'
require 'net/http'

# Filtering by profile ID.
url = URI("https://api.opentransact.com/v1/accounts?filter%5Bowner-id%5D=#{profile_id}&filter%5Bowner-type%5D=profiles")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["authorization"] = "Bearer #{API_KEY}"

response = http.request(request)
puts response.read_body
curl --request GET \
  --url 'https://api.opentransact.com/v1/accounts?filter%5Bowner-id%5D=$PROFILE_ID&filter%5Bowner-type%5D=profiles' \
  --header 'authorization: Bearer $API_KEY'