Skip to content
v1.0.0

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!

Empty placeholder image showing the width/height

Contact

Servers

https://galaxy.scalar.com
{protocol}://void.scalar.com/{path}Responds with your request data

Operation ID: getAllData

Get all planets

GET
/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

limit

The number of items to return

Typeinteger
offset

The number of items to skip before starting to collect the result set

Typeinteger

Responses

OK
JSON
{
"data": [
{
"id": 0,
"name": "string",
"description": null,
"image": "string",
"creator": {
"id": 0,
"name": "string",
"email": "string"
}
}
],
"meta": {
"limit": 0,
"offset": 0,
"total": 0,
"next": null
}
}

Samples

cURL
curl -X GET https://galaxy.scalar.com/planets
JavaScript
fetch("https://galaxy.scalar.com/planets")
  .then(response => response.json())
  .then(data => console.log(data));
PHP
file_get_contents("https://galaxy.scalar.com/planets");
Python
import requests
response = requests.get("https://galaxy.scalar.com/planets")
print(response.json())
Operation ID: createPlanet

Create a planet

POST
/planets

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

JSON
{
"id": 0,
"name": "string",
"description": null,
"image": "string",
"creator": {
"id": 0,
"name": "string",
"email": "string"
}
}

Responses

Created
JSON
{
"id": 0,
"name": "string",
"description": null,
"image": "string",
"creator": {
"id": 0,
"name": "string",
"email": "string"
}
}

Samples

cURL
curl -X POST https://galaxy.scalar.com/planets
JavaScript
fetch("https://galaxy.scalar.com/planets", { method: "POST" })
  .then(response => response.json())
  .then(data => console.log(data));
PHP
$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;
Python
import requests
response = requests.post("https://galaxy.scalar.com/planets")
print(response.json())

Operation ID: getPlanet

Get a planet

GET
/planets/{planetId}

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

planetId*
Typeinteger
Required

Responses

Planet Found
JSON
{
"id": 0,
"name": "string",
"description": null,
"image": "string",
"creator": {
"id": 0,
"name": "string",
"email": "string"
}
}

Samples

cURL
curl -X GET https://galaxy.scalar.com/planets/{planetId}
JavaScript
fetch("https://galaxy.scalar.com/planets/{planetId}")
  .then(response => response.json())
  .then(data => console.log(data));
PHP
file_get_contents("https://galaxy.scalar.com/planets/{planetId}");
Python
import requests
response = requests.get("https://galaxy.scalar.com/planets/{planetId}")
print(response.json())
Operation ID: updatePlanet

Update a planet

PUT
/planets/{planetId}

Sometimes you make mistakes, that’s fine. No worries, you can update all planets.

Authorizations

Parameters

Path Parameters

planetId*
Typeinteger
Required

Request Body

JSON
{
"id": 0,
"name": "string",
"description": null,
"image": "string",
"creator": {
"id": 0,
"name": "string",
"email": "string"
}
}

Responses

OK
JSON
{
"id": 0,
"name": "string",
"description": null,
"image": "string",
"creator": {
"id": 0,
"name": "string",
"email": "string"
}
}

Samples

cURL
curl -X PUT https://galaxy.scalar.com/planets/{planetId}
JavaScript
fetch("https://galaxy.scalar.com/planets/{planetId}", { method: "PUT" })
  .then(response => response.json())
  .then(data => console.log(data));
PHP
$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;
Python
import requests
response = requests.put("https://galaxy.scalar.com/planets/{planetId}")
print(response.json())
Deprecated
Operation ID: deletePlanet

Delete a planet

DELETE
/planets/{planetId}

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

planetId*
Typeinteger
Required

Responses

No Content

Samples

cURL
curl -X DELETE https://galaxy.scalar.com/planets/{planetId}
JavaScript
fetch("https://galaxy.scalar.com/planets/{planetId}", { method: "DELETE" })
  .then(response => response.json())
  .then(data => console.log(data));
PHP
$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;
Python
import requests
response = requests.delete("https://galaxy.scalar.com/planets/{planetId}")
print(response.json())

Operation ID: uploadImage

Upload an image to a planet

POST
/planets/{planetId}/image

Got a crazy good photo of a planet? Share it with the world!

Authorizations

Parameters

Path Parameters

planetId*
Typeinteger
Required

Responses

Image uploaded
JSON
{
"message": "string"
}

Samples

cURL
curl -X POST https://galaxy.scalar.com/planets/{planetId}/image
JavaScript
fetch("https://galaxy.scalar.com/planets/{planetId}/image", { method: "POST" })
  .then(response => response.json())
  .then(data => console.log(data));
PHP
$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;
Python
import requests
response = requests.post("https://galaxy.scalar.com/planets/{planetId}/image")
print(response.json())

Operation ID: createUser

Create a user

POST
/user/signup

Time to create a user account, eh?

Request Body

JSON
{
"name": "string",
"email": "string",
"password": "string"
}

Responses

Created
JSON
{
"id": 0,
"name": "string",
"email": "string"
}

Samples

cURL
curl -X POST https://galaxy.scalar.com/user/signup
JavaScript
fetch("https://galaxy.scalar.com/user/signup", { method: "POST" })
  .then(response => response.json())
  .then(data => console.log(data));
PHP
$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;
Python
import requests
response = requests.post("https://galaxy.scalar.com/user/signup")
print(response.json())

Operation ID: getToken

Get a token

POST
/auth/token

Yeah, this is the boring security stuff. Just get your super secret token and move on.

Request Body

JSON
{
"email": "string",
"password": "string"
}

Responses

Token Created
JSON
{
"token": "string"
}

Samples

cURL
curl -X POST https://galaxy.scalar.com/auth/token
JavaScript
fetch("https://galaxy.scalar.com/auth/token", { method: "POST" })
  .then(response => response.json())
  .then(data => console.log(data));
PHP
$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;
Python
import requests
response = requests.post("https://galaxy.scalar.com/auth/token")
print(response.json())

Operation ID: getMe

Get authenticated user

GET
/me

Find yourself they say. That’s what you can do here.

Authorizations

Responses

OK
JSON
{
"id": 0,
"name": "string",
"email": "string"
}

Samples

cURL
curl -X GET https://galaxy.scalar.com/me
JavaScript
fetch("https://galaxy.scalar.com/me")
  .then(response => response.json())
  .then(data => console.log(data));
PHP
file_get_contents("https://galaxy.scalar.com/me");
Python
import requests
response = requests.get("https://galaxy.scalar.com/me")
print(response.json())

Powered by VitePress OpenAPI