Scalar Galaxy
The Scalar Galaxy is an example OpenAPI specification to test OpenAPI tools and libraries. It’s a fictional universe with fictional planets and fictional data. Get all the data for all planets.
Resources
- https://github.com/scalar/scalar
- https://github.com/OAI/OpenAPI-Specification
- https://scalar.com
Markdown Support
All descriptions can contain tons of text Markdown. If GitHub supports the syntax, chances are we’re supporting it, too. You can even create internal links to reference endpoints.
Examples
Blockquotes
I love OpenAPI. <3
Tables
Feature | Availability |
---|---|
Markdown Support | ✓ |
Accordion
<details>
<summary>Using Details Tags</summary>
<p>HTML Example</p>
</details>
Images
Yes, there’s support for images, too!
Contact
Servers
Get all planets
It’s easy to say you know them all, but do you really? Retrieve all the planets and check whether you missed one.
Parameters
Query Parameters
The number of items to return
The number of items to skip before starting to collect the result set
Responses
Samples
curl -X GET https://galaxy.scalar.com/planets
fetch("https://galaxy.scalar.com/planets")
.then(response => response.json())
.then(data => console.log(data));
file_get_contents("https://galaxy.scalar.com/planets");
import requests
response = requests.get("https://galaxy.scalar.com/planets")
print(response.json())
Create a planet
Time to play god and create a new planet. What do you think? Ah, don’t think too much. What could go wrong anyway?
Authorizations
Request Body
Responses
Samples
curl -X POST https://galaxy.scalar.com/planets
fetch("https://galaxy.scalar.com/planets", { method: "POST" })
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://galaxy.scalar.com/planets");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
response = requests.post("https://galaxy.scalar.com/planets")
print(response.json())
Get a planet
You’ll better learn a little bit more about the planets. It might come in handy once space travel is available for everyone.
Parameters
Path Parameters
Responses
Samples
curl -X GET https://galaxy.scalar.com/planets/{planetId}
fetch("https://galaxy.scalar.com/planets/{planetId}")
.then(response => response.json())
.then(data => console.log(data));
file_get_contents("https://galaxy.scalar.com/planets/{planetId}");
import requests
response = requests.get("https://galaxy.scalar.com/planets/{planetId}")
print(response.json())
Update a planet
Sometimes you make mistakes, that’s fine. No worries, you can update all planets.
Authorizations
Parameters
Path Parameters
Request Body
Responses
Samples
curl -X PUT https://galaxy.scalar.com/planets/{planetId}
fetch("https://galaxy.scalar.com/planets/{planetId}", { method: "PUT" })
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://galaxy.scalar.com/planets/{planetId}");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
response = requests.put("https://galaxy.scalar.com/planets/{planetId}")
print(response.json())
Delete a planet
This 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.
Authorizations
Parameters
Path Parameters
Responses
Samples
curl -X DELETE https://galaxy.scalar.com/planets/{planetId}
fetch("https://galaxy.scalar.com/planets/{planetId}", { method: "DELETE" })
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://galaxy.scalar.com/planets/{planetId}");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
response = requests.delete("https://galaxy.scalar.com/planets/{planetId}")
print(response.json())
Upload an image to a planet
Got a crazy good photo of a planet? Share it with the world!
Authorizations
Parameters
Path Parameters
Responses
Samples
curl -X POST https://galaxy.scalar.com/planets/{planetId}/image
fetch("https://galaxy.scalar.com/planets/{planetId}/image", { method: "POST" })
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://galaxy.scalar.com/planets/{planetId}/image");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
response = requests.post("https://galaxy.scalar.com/planets/{planetId}/image")
print(response.json())
Create a user
Time to create a user account, eh?
Request Body
Responses
Samples
curl -X POST https://galaxy.scalar.com/user/signup
fetch("https://galaxy.scalar.com/user/signup", { method: "POST" })
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://galaxy.scalar.com/user/signup");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
response = requests.post("https://galaxy.scalar.com/user/signup")
print(response.json())
Get a token
Yeah, this is the boring security stuff. Just get your super secret token and move on.
Request Body
Responses
Samples
curl -X POST https://galaxy.scalar.com/auth/token
fetch("https://galaxy.scalar.com/auth/token", { method: "POST" })
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://galaxy.scalar.com/auth/token");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
response = requests.post("https://galaxy.scalar.com/auth/token")
print(response.json())
Get authenticated user
Find yourself they say. That’s what you can do here.
Authorizations
Responses
Samples
curl -X GET https://galaxy.scalar.com/me
fetch("https://galaxy.scalar.com/me")
.then(response => response.json())
.then(data => console.log(data));
file_get_contents("https://galaxy.scalar.com/me");
import requests
response = requests.get("https://galaxy.scalar.com/me")
print(response.json())