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
Planets
Everything about planets
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
int64
10
The number of items to skip before starting to collect the result set
int64
0
Responses
Samples
get {
url: https://galaxy.scalar.com/planets
}
headers {
Content-Type: application/json
}
get {
url: https://galaxy.scalar.com/planets
}
headers {
Content-Type: application/json
}
curl -X GET \
'https://galaxy.scalar.com/planets' \
-H "Content-Type: application/json"
fetch('https://galaxy.scalar.com/planets', {headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'https://galaxy.scalar.com/planets';
$method = 'GET';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'https://galaxy.scalar.com/planets'
headers = {
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
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
JWT Bearer token authentication
Basic HTTP authentication
API key query parameter
API key request header
API key browser cookie
OAuth 2.0 authentication
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
Request Body
Responses
Samples
post {
url: https://galaxy.scalar.com/planets
}
headers {
Content-Type: application/json
}
post {
url: https://galaxy.scalar.com/planets
}
headers {
Content-Type: application/json
}
curl -X POST \
'https://galaxy.scalar.com/planets' \
-H "Content-Type: application/json"
fetch('https://galaxy.scalar.com/planets', {method:'POST',headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'https://galaxy.scalar.com/planets';
$method = 'POST';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'https://galaxy.scalar.com/planets'
headers = {
'Content-Type': 'application/json'
}
response = requests.post(url, headers=headers)
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
1
int64
Responses
Samples
get {
url: https://galaxy.scalar.com/planets/1
}
headers {
Content-Type: application/json
}
get {
url: https://galaxy.scalar.com/planets/1
}
headers {
Content-Type: application/json
}
curl -X GET \
'https://galaxy.scalar.com/planets/1' \
-H "Content-Type: application/json"
fetch('https://galaxy.scalar.com/planets/1', {headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'https://galaxy.scalar.com/planets/1';
$method = 'GET';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'https://galaxy.scalar.com/planets/1'
headers = {
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
print(response.json())
Update a planet
Sometimes you make mistakes, that’s fine. No worries, you can update all planets.
Authorizations
JWT Bearer token authentication
Basic HTTP authentication
API key query parameter
API key request header
API key browser cookie
OAuth 2.0 authentication
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
Parameters
Path Parameters
1
int64
Request Body
Responses
Samples
put {
url: https://galaxy.scalar.com/planets/1
}
headers {
Content-Type: application/json
}
put {
url: https://galaxy.scalar.com/planets/1
}
headers {
Content-Type: application/json
}
curl -X PUT \
'https://galaxy.scalar.com/planets/1' \
-H "Content-Type: application/json"
fetch('https://galaxy.scalar.com/planets/1', {method:'PUT',headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'https://galaxy.scalar.com/planets/1';
$method = 'PUT';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'https://galaxy.scalar.com/planets/1'
headers = {
'Content-Type': 'application/json'
}
response = requests.put(url, headers=headers)
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
JWT Bearer token authentication
Basic HTTP authentication
API key query parameter
API key request header
API key browser cookie
OAuth 2.0 authentication
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
Parameters
Path Parameters
1
int64
Responses
Samples
delete {
url: https://galaxy.scalar.com/planets/1
}
headers {
Content-Type: application/json
}
delete {
url: https://galaxy.scalar.com/planets/1
}
headers {
Content-Type: application/json
}
curl -X DELETE \
'https://galaxy.scalar.com/planets/1' \
-H "Content-Type: application/json"
fetch('https://galaxy.scalar.com/planets/1', {method:'DELETE',headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'https://galaxy.scalar.com/planets/1';
$method = 'DELETE';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'https://galaxy.scalar.com/planets/1'
headers = {
'Content-Type': 'application/json'
}
response = requests.delete(url, headers=headers)
print(response.json())
Upload an image to a planet
Got a crazy good photo of a planet? Share it with the world!
Authorizations
JWT Bearer token authentication
Basic HTTP authentication
API key query parameter
API key request header
API key browser cookie
OAuth 2.0 authentication
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
Parameters
Path Parameters
1
int64
Request Body
Responses
Samples
post {
url: https://galaxy.scalar.com/planets/1/image
}
headers {
Content-Type: application/json
}
post {
url: https://galaxy.scalar.com/planets/1/image
}
headers {
Content-Type: application/json
}
curl -X POST \
'https://galaxy.scalar.com/planets/1/image' \
-H "Content-Type: application/json"
fetch('https://galaxy.scalar.com/planets/1/image', {method:'POST',headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'https://galaxy.scalar.com/planets/1/image';
$method = 'POST';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'https://galaxy.scalar.com/planets/1/image'
headers = {
'Content-Type': 'application/json'
}
response = requests.post(url, headers=headers)
print(response.json())
Authentication
Some endpoints are public, but some require authentication. We provide all the required endpoints to create an account and authorize yourself.
Create a user
Time to create a user account, eh?
Request Body
Responses
Samples
post {
url: https://galaxy.scalar.com/user/signup
}
headers {
Content-Type: application/json
}
post {
url: https://galaxy.scalar.com/user/signup
}
headers {
Content-Type: application/json
}
curl -X POST \
'https://galaxy.scalar.com/user/signup' \
-H "Content-Type: application/json"
fetch('https://galaxy.scalar.com/user/signup', {method:'POST',headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'https://galaxy.scalar.com/user/signup';
$method = 'POST';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'https://galaxy.scalar.com/user/signup'
headers = {
'Content-Type': 'application/json'
}
response = requests.post(url, headers=headers)
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
post {
url: https://galaxy.scalar.com/auth/token
}
headers {
Content-Type: application/json
}
post {
url: https://galaxy.scalar.com/auth/token
}
headers {
Content-Type: application/json
}
curl -X POST \
'https://galaxy.scalar.com/auth/token' \
-H "Content-Type: application/json"
fetch('https://galaxy.scalar.com/auth/token', {method:'POST',headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'https://galaxy.scalar.com/auth/token';
$method = 'POST';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'https://galaxy.scalar.com/auth/token'
headers = {
'Content-Type': 'application/json'
}
response = requests.post(url, headers=headers)
print(response.json())
Get authenticated user
Find yourself they say. That’s what you can do here.
Authorizations
Basic HTTP authentication
OAuth 2.0 authentication
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
- read:account: read your account information
- write:planets: modify planets in your account
- read:planets: read your planets
JWT Bearer token authentication
API key request header
API key query parameter
Responses
Samples
get {
url: https://galaxy.scalar.com/me
}
headers {
Content-Type: application/json
}
get {
url: https://galaxy.scalar.com/me
}
headers {
Content-Type: application/json
}
curl -X GET \
'https://galaxy.scalar.com/me' \
-H "Content-Type: application/json"
fetch('https://galaxy.scalar.com/me', {headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'https://galaxy.scalar.com/me';
$method = 'GET';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'https://galaxy.scalar.com/me'
headers = {
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
print(response.json())