camp-api/lib/camp_api/grist.ex
Pierre de Lacroix e1a6b72c44
add gauge API
2026-01-22 19:26:40 +01:00

15 lines
407 B
Elixir

defmodule CampApi.Grist do
@moduledoc false
@api_url "https://grist.interhacker.space/o/camp"
def get_records(doc, table) do
url = "#{@api_url}/api/docs/#{doc}/tables/#{table}/records"
request(:get, url)
end
defp request(method, url) do
Req.request(method: method, url: url, headers: [{"authorization", "Bearer " <> Application.fetch_env!(:camp_api, :grist)[:api_key]}])
end
end