Complete reference of every operation, grouped by resource. See the README for usage and configuration.
require "galaxy-ruby"
client = ScalarGalaxy::Client.new(
bearer_auth: ENV["BEARER_AUTH"], # defaults to the BEARER_AUTH env var
)Everything about planets
It's easy to say you know them all, but do you really? Retrieve all the planets and check whether you missed one.
| Direction | Type |
|---|---|
| Request | PlanetListAllDataParams |
| Response | PlanetListAllDataResponse |
response = client.planets.list_all_data({ limit: 10, offset: 0 })
puts response.inspectTime to play god and create a new planet. What do you think? Ah, don't think too much. What could go wrong anyway?
| Direction | Type |
|---|---|
| Request | PlanetCreateParams |
| Response | Planet |
response = client.planets.create({ id: 1, name: "Mars", atmosphere: [{ }], creator: { }, description: "The red planet", discovered_at: "1610-01-07T00:00:00Z", failure_callback_url: "https://example.com/webhook", habitability_index: 0.68, image: "https://cdn.scalar.com/photos/mars.jpg", last_updated: "2024-01-15T14:30:00Z", physical_properties: { }, satellites: [{ "name" => "Phobos" }], success_callback_url: "https://example.com/webhook", tags: [""], type: "terrestrial" })
puts response.inspectYou'll better learn a little bit more about the planets. It might come in handy once space travel is available for everyone.
| Direction | Type |
|---|---|
| Request | PlanetRetrieveParams |
| Response | Planet |
response = client.planets.retrieve(1)
puts response.inspectSometimes you make mistakes, that's fine. No worries, you can update all planets.
| Direction | Type |
|---|---|
| Request | PlanetUpdateParams |
| Response | Planet |
response = client.planets.update(1, { id: 1, name: "Mars", atmosphere: [{ }], creator: { }, description: "The red planet", discovered_at: "1610-01-07T00:00:00Z", failure_callback_url: "https://example.com/webhook", habitability_index: 0.68, image: "https://cdn.scalar.com/photos/mars.jpg", last_updated: "2024-01-15T14:30:00Z", physical_properties: { }, satellites: [{ "name" => "Phobos" }], success_callback_url: "https://example.com/webhook", tags: [""], type: "terrestrial" })
puts response.inspectThis endpoint was used to delete planets. Unfortunately, that caused a lot of trouble for planets with life. So, this endpoint is now deprecated and should not be used anymore.
| Direction | Type |
|---|---|
| Request | PlanetDeleteParams |
client.planets.delete(1)Got a crazy good photo of a planet? Share it with the world!
| Direction | Type |
|---|---|
| Request | PlanetDelteImageParams |
| Response | PlanetDelteImageResponse |
response = client.planets.delte_image(1, { image: "@mars.jpg" })
puts response.inspectCelestial bodies are the planets and satellites in the Scalar Galaxy.
Stars, moons, comets, the occasional rogue asteroid — if it glows or drifts through the void, you can add it here.
| Direction | Type |
|---|---|
| Request | CelestialBodyCreateParams |
| Response | CelestialBody |
response = client.celestial_bodies.create({ celestial_body: { "name" => "Mars" } })
puts response.inspectSome endpoints are public, but some require authentication. We provide all the required endpoints to create an account and authorize yourself.
Time to create a user account, eh?
| Direction | Type |
|---|---|
| Request | AuthenticationCreateUserParams |
| Response | User |
response = client.authentication.create_user({ email: "marc@scalar.com", password: "i-love-scalar", name: "Marc" })
puts response.inspectYeah, this is the boring security stuff. Just get your super secret token and move on.
| Direction | Type |
|---|---|
| Request | AuthenticationCreateTokenParams |
| Response | AuthenticationCreateTokenResponse |
response = client.authentication.create_token({ email: "marc@scalar.com", password: "i-love-scalar" })
puts response.inspectFind yourself they say. That's what you can do here.
| Direction | Type |
|---|---|
| Request | AuthenticationListMeParams |
| Response | User |
response = client.authentication.list_me
puts response.inspect