Update a planet
Sometimes you make mistakes, that's fine. No worries, you can update all planets.
https://galaxy.scalar.com/planets/{planetId}Try it
path Parameters
The ID of the planet to get
Authorization
bearerAuth (bearer)
JWT Bearer token authentication
basicAuth (basic)
Basic HTTP authentication
apiKeyQuery (query: api_key)
API key query parameter
apiKeyHeader (header: X-API-Key)
API key request header
apiKeyCookie (cookie: api_key)
API key browser cookie
oAuth2 (oauth2)
OAuth 2.0 authentication
openIdConnect (openIdConnect)
OpenID Connect Authentication
Request Body
New information about the planet
A planet in the Scalar Galaxy
idnamedescription?type?habitabilityIndex?A score from 0 to 1 indicating potential habitability
physicalProperties?Map value
[key: string]?Additional physical measurements for the planet
mass?Mass in Earth masses (must be greater than 0)
radius?Radius in Earth radii (must be greater than 0)
gravity?Surface gravity in Earth g
temperature?Map value
[key: string]?Additional temperature-related measurements in Kelvin
min?Minimum temperature in Kelvin
max?Maximum temperature in Kelvin
average?Average temperature in Kelvin
atmosphere?Atmospheric composition
Map value
[key: string]?Additional atmospheric composition data
compound?percentage?discoveredAt?image?satellites?creator?tags?lastUpdated?successCallbackUrl?URL which gets invoked upon a successful operation
failureCallbackUrl?URL which gets invoked upon a failed operation
A planet in the Scalar Galaxy
idnamedescription?type?habitabilityIndex?A score from 0 to 1 indicating potential habitability
physicalProperties?Map value
[key: string]?Additional physical measurements for the planet
mass?Mass in Earth masses (must be greater than 0)
radius?Radius in Earth radii (must be greater than 0)
gravity?Surface gravity in Earth g
temperature?Map value
[key: string]?Additional temperature-related measurements in Kelvin
min?Minimum temperature in Kelvin
max?Maximum temperature in Kelvin
average?Average temperature in Kelvin
atmosphere?Atmospheric composition
Map value
[key: string]?Additional atmospheric composition data
compound?percentage?discoveredAt?image?satellites?creator?tags?lastUpdated?successCallbackUrl?URL which gets invoked upon a successful operation
failureCallbackUrl?URL which gets invoked upon a failed operation
Responses
200Planet updated successfully
200Planet updated successfully
A planet in the Scalar Galaxy
idnamedescription?type?habitabilityIndex?A score from 0 to 1 indicating potential habitability
physicalProperties?Map value
[key: string]?Additional physical measurements for the planet
mass?Mass in Earth masses (must be greater than 0)
radius?Radius in Earth radii (must be greater than 0)
gravity?Surface gravity in Earth g
temperature?Map value
[key: string]?Additional temperature-related measurements in Kelvin
min?Minimum temperature in Kelvin
max?Maximum temperature in Kelvin
average?Average temperature in Kelvin
atmosphere?Atmospheric composition
Map value
[key: string]?Additional atmospheric composition data
compound?percentage?discoveredAt?image?satellites?creator?tags?lastUpdated?successCallbackUrl?URL which gets invoked upon a successful operation
failureCallbackUrl?URL which gets invoked upon a failed operation
A planet in the Scalar Galaxy
idnamedescription?type?habitabilityIndex?A score from 0 to 1 indicating potential habitability
physicalProperties?Map value
[key: string]?Additional physical measurements for the planet
mass?Mass in Earth masses (must be greater than 0)
radius?Radius in Earth radii (must be greater than 0)
gravity?Surface gravity in Earth g
temperature?Map value
[key: string]?Additional temperature-related measurements in Kelvin
min?Minimum temperature in Kelvin
max?Maximum temperature in Kelvin
average?Average temperature in Kelvin
atmosphere?Atmospheric composition
Map value
[key: string]?Additional atmospheric composition data
compound?percentage?discoveredAt?image?satellites?creator?tags?lastUpdated?successCallbackUrl?URL which gets invoked upon a successful operation
failureCallbackUrl?URL which gets invoked upon a failed operation
400Bad Request
400Bad Request
RFC 7807 (https://datatracker.ietf.org/doc/html/rfc7807)
type?title?status?detail?RFC 7807 (https://datatracker.ietf.org/doc/html/rfc7807)
type?title?status?detail?403Forbidden
403Forbidden
Error response for forbidden access (RFC 7807). Returned when the user does not have permission to access the requested resource.
type?title?status?detail?Error response for forbidden access (RFC 7807). Returned when the user does not have permission to access the requested resource.
type?title?status?detail?404Not Found
404Not Found
Error response for resource not found (RFC 7807). Returned when the requested resource does not exist.
type?title?status?detail?Error response for resource not found (RFC 7807). Returned when the requested resource does not exist.
type?title?status?detail?Code Samples
curl -X PUT 'https://galaxy.scalar.com/planets/{planetId}' \
-H 'Authorization: Basic <base64-credentials>' \
-H 'X-API-Key: <X-API-Key>' \
-H 'Content-Type: application/json' \
-d '{
"name": "Mars",
"description": "The red planet",
"type": "terrestrial",
"habitabilityIndex": 0.68,
"physicalProperties": {
"mass": 0.107,
"radius": 0.532,
"gravity": 0.378,
"temperature": {
"min": 130,
"max": 308,
"average": 210,
"temperatureMetric1": 0.1,
"temperatureMetric2": 0.1
},
"measurement1": 0.1,
"measurement2": 0.1
},
"atmosphere": [
{
"compound": "CO2",
"percentage": 95.3,
"atmosphericData1": "string",
"atmosphericData2": "string"
}
],
"discoveredAt": "1610-01-07T00:00:00.000Z",
"image": "https://cdn.scalar.com/photos/mars.jpg",
"satellites": [
{
"name": "Phobos",
"description": "Phobos is the larger and innermost of the two moons of Mars.",
"diameter": 22.2,
"type": "moon",
"orbit": {
"planet": {
"name": "Mars",
"description": "The red planet",
"type": "terrestrial",
"habitabilityIndex": 0.68,
"physicalProperties": {
"mass": 0.107,
"radius": 0.532,
"gravity": 0.378,
"temperature": {
"min": 130,
"max": 308,
"average": 210,
"temperatureMetric1": 0.1,
"temperatureMetric2": 0.1
},
"measurement1": 0.1,
"measurement2": 0.1
},
"atmosphere": [
{
"compound": "CO2",
"percentage": 95.3,
"atmosphericData1": "string",
"atmosphericData2": "string"
}
],
"discoveredAt": "1610-01-07T00:00:00.000Z",
"image": "https://cdn.scalar.com/photos/mars.jpg",
"satellites": [],
"creator": {
"name": "Marc"
},
"tags": [
"solar-system",
"rocky",
"explored"
],
"successCallbackUrl": "https://example.com/webhook",
"failureCallbackUrl": "https://example.com/webhook"
},
"orbitalPeriod": 0.319,
"distance": 9376
}
}
],
"creator": {
"name": "Marc"
},
"tags": [
"solar-system",
"rocky",
"explored"
],
"successCallbackUrl": "https://example.com/webhook",
"failureCallbackUrl": "https://example.com/webhook"
}'const response = await fetch("https://galaxy.scalar.com/planets/{planetId}", {
method: "PUT",
headers: {
"Authorization": "Basic <base64-credentials>",
"X-API-Key": "<X-API-Key>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "Mars",
"description": "The red planet",
"type": "terrestrial",
"habitabilityIndex": 0.68,
"physicalProperties": {
"mass": 0.107,
"radius": 0.532,
"gravity": 0.378,
"temperature": {
"min": 130,
"max": 308,
"average": 210,
"temperatureMetric1": 0.1,
"temperatureMetric2": 0.1
},
"measurement1": 0.1,
"measurement2": 0.1
},
"atmosphere": [
{
"compound": "CO2",
"percentage": 95.3,
"atmosphericData1": "string",
"atmosphericData2": "string"
}
],
"discoveredAt": "1610-01-07T00:00:00.000Z",
"image": "https://cdn.scalar.com/photos/mars.jpg",
"satellites": [
{
"name": "Phobos",
"description": "Phobos is the larger and innermost of the two moons of Mars.",
"diameter": 22.2,
"type": "moon",
"orbit": {
"planet": {
"name": "Mars",
"description": "The red planet",
"type": "terrestrial",
"habitabilityIndex": 0.68,
"physicalProperties": {
"mass": 0.107,
"radius": 0.532,
"gravity": 0.378,
"temperature": {
"min": 130,
"max": 308,
"average": 210,
"temperatureMetric1": 0.1,
"temperatureMetric2": 0.1
},
"measurement1": 0.1,
"measurement2": 0.1
},
"atmosphere": [
{
"compound": "CO2",
"percentage": 95.3,
"atmosphericData1": "string",
"atmosphericData2": "string"
}
],
"discoveredAt": "1610-01-07T00:00:00.000Z",
"image": "https://cdn.scalar.com/photos/mars.jpg",
"satellites": [],
"creator": {
"name": "Marc"
},
"tags": [
"solar-system",
"rocky",
"explored"
],
"successCallbackUrl": "https://example.com/webhook",
"failureCallbackUrl": "https://example.com/webhook"
},
"orbitalPeriod": 0.319,
"distance": 9376
}
}
],
"creator": {
"name": "Marc"
},
"tags": [
"solar-system",
"rocky",
"explored"
],
"successCallbackUrl": "https://example.com/webhook",
"failureCallbackUrl": "https://example.com/webhook"
}),
});
const data = await response.json();
console.log(data);import requests
response = requests.request(
"PUT",
"https://galaxy.scalar.com/planets/{planetId}",
headers={
"Authorization": "Basic <base64-credentials>",
"X-API-Key": "<X-API-Key>"
},
json={
"name": "Mars",
"description": "The red planet",
"type": "terrestrial",
"habitabilityIndex": 0.68,
"physicalProperties": {
"mass": 0.107,
"radius": 0.532,
"gravity": 0.378,
"temperature": {
"min": 130,
"max": 308,
"average": 210,
"temperatureMetric1": 0.1,
"temperatureMetric2": 0.1
},
"measurement1": 0.1,
"measurement2": 0.1
},
"atmosphere": [
{
"compound": "CO2",
"percentage": 95.3,
"atmosphericData1": "string",
"atmosphericData2": "string"
}
],
"discoveredAt": "1610-01-07T00:00:00.000Z",
"image": "https://cdn.scalar.com/photos/mars.jpg",
"satellites": [
{
"name": "Phobos",
"description": "Phobos is the larger and innermost of the two moons of Mars.",
"diameter": 22.2,
"type": "moon",
"orbit": {
"planet": {
"name": "Mars",
"description": "The red planet",
"type": "terrestrial",
"habitabilityIndex": 0.68,
"physicalProperties": {
"mass": 0.107,
"radius": 0.532,
"gravity": 0.378,
"temperature": {
"min": 130,
"max": 308,
"average": 210,
"temperatureMetric1": 0.1,
"temperatureMetric2": 0.1
},
"measurement1": 0.1,
"measurement2": 0.1
},
"atmosphere": [
{
"compound": "CO2",
"percentage": 95.3,
"atmosphericData1": "string",
"atmosphericData2": "string"
}
],
"discoveredAt": "1610-01-07T00:00:00.000Z",
"image": "https://cdn.scalar.com/photos/mars.jpg",
"satellites": [],
"creator": {
"name": "Marc"
},
"tags": [
"solar-system",
"rocky",
"explored"
],
"successCallbackUrl": "https://example.com/webhook",
"failureCallbackUrl": "https://example.com/webhook"
},
"orbitalPeriod": 0.319,
"distance": 9376
}
}
],
"creator": {
"name": "Marc"
},
"tags": [
"solar-system",
"rocky",
"explored"
],
"successCallbackUrl": "https://example.com/webhook",
"failureCallbackUrl": "https://example.com/webhook"
},
)
print(response.json())package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"name": "Mars",
"description": "The red planet",
"type": "terrestrial",
"habitabilityIndex": 0.68,
"physicalProperties": {
"mass": 0.107,
"radius": 0.532,
"gravity": 0.378,
"temperature": {
"min": 130,
"max": 308,
"average": 210,
"temperatureMetric1": 0.1,
"temperatureMetric2": 0.1
},
"measurement1": 0.1,
"measurement2": 0.1
},
"atmosphere": [
{
"compound": "CO2",
"percentage": 95.3,
"atmosphericData1": "string",
"atmosphericData2": "string"
}
],
"discoveredAt": "1610-01-07T00:00:00.000Z",
"image": "https://cdn.scalar.com/photos/mars.jpg",
"satellites": [
{
"name": "Phobos",
"description": "Phobos is the larger and innermost of the two moons of Mars.",
"diameter": 22.2,
"type": "moon",
"orbit": {
"planet": {
"name": "Mars",
"description": "The red planet",
"type": "terrestrial",
"habitabilityIndex": 0.68,
"physicalProperties": {
"mass": 0.107,
"radius": 0.532,
"gravity": 0.378,
"temperature": {
"min": 130,
"max": 308,
"average": 210,
"temperatureMetric1": 0.1,
"temperatureMetric2": 0.1
},
"measurement1": 0.1,
"measurement2": 0.1
},
"atmosphere": [
{
"compound": "CO2",
"percentage": 95.3,
"atmosphericData1": "string",
"atmosphericData2": "string"
}
],
"discoveredAt": "1610-01-07T00:00:00.000Z",
"image": "https://cdn.scalar.com/photos/mars.jpg",
"satellites": [],
"creator": {
"name": "Marc"
},
"tags": [
"solar-system",
"rocky",
"explored"
],
"successCallbackUrl": "https://example.com/webhook",
"failureCallbackUrl": "https://example.com/webhook"
},
"orbitalPeriod": 0.319,
"distance": 9376
}
}
],
"creator": {
"name": "Marc"
},
"tags": [
"solar-system",
"rocky",
"explored"
],
"successCallbackUrl": "https://example.com/webhook",
"failureCallbackUrl": "https://example.com/webhook"
}`)
req, err := http.NewRequest("PUT", "https://galaxy.scalar.com/planets/{planetId}", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Basic <base64-credentials>")
req.Header.Set("X-API-Key", "<X-API-Key>")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(string(data))
}using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("PUT"), "https://galaxy.scalar.com/planets/{planetId}");
request.Headers.TryAddWithoutValidation("Authorization", "Basic <base64-credentials>");
request.Headers.TryAddWithoutValidation("X-API-Key", "<X-API-Key>");
request.Content = new StringContent("""{
"name": "Mars",
"description": "The red planet",
"type": "terrestrial",
"habitabilityIndex": 0.68,
"physicalProperties": {
"mass": 0.107,
"radius": 0.532,
"gravity": 0.378,
"temperature": {
"min": 130,
"max": 308,
"average": 210,
"temperatureMetric1": 0.1,
"temperatureMetric2": 0.1
},
"measurement1": 0.1,
"measurement2": 0.1
},
"atmosphere": [
{
"compound": "CO2",
"percentage": 95.3,
"atmosphericData1": "string",
"atmosphericData2": "string"
}
],
"discoveredAt": "1610-01-07T00:00:00.000Z",
"image": "https://cdn.scalar.com/photos/mars.jpg",
"satellites": [
{
"name": "Phobos",
"description": "Phobos is the larger and innermost of the two moons of Mars.",
"diameter": 22.2,
"type": "moon",
"orbit": {
"planet": {
"name": "Mars",
"description": "The red planet",
"type": "terrestrial",
"habitabilityIndex": 0.68,
"physicalProperties": {
"mass": 0.107,
"radius": 0.532,
"gravity": 0.378,
"temperature": {
"min": 130,
"max": 308,
"average": 210,
"temperatureMetric1": 0.1,
"temperatureMetric2": 0.1
},
"measurement1": 0.1,
"measurement2": 0.1
},
"atmosphere": [
{
"compound": "CO2",
"percentage": 95.3,
"atmosphericData1": "string",
"atmosphericData2": "string"
}
],
"discoveredAt": "1610-01-07T00:00:00.000Z",
"image": "https://cdn.scalar.com/photos/mars.jpg",
"satellites": [],
"creator": {
"name": "Marc"
},
"tags": [
"solar-system",
"rocky",
"explored"
],
"successCallbackUrl": "https://example.com/webhook",
"failureCallbackUrl": "https://example.com/webhook"
},
"orbitalPeriod": 0.319,
"distance": 9376
}
}
],
"creator": {
"name": "Marc"
},
"tags": [
"solar-system",
"rocky",
"explored"
],
"successCallbackUrl": "https://example.com/webhook",
"failureCallbackUrl": "https://example.com/webhook"
}""", System.Text.Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
.uri(URI.create("https://galaxy.scalar.com/planets/{planetId}"))
.header("Authorization", "Basic <base64-credentials>")
.header("X-API-Key", "<X-API-Key>")
.header("Content-Type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("""{
"name": "Mars",
"description": "The red planet",
"type": "terrestrial",
"habitabilityIndex": 0.68,
"physicalProperties": {
"mass": 0.107,
"radius": 0.532,
"gravity": 0.378,
"temperature": {
"min": 130,
"max": 308,
"average": 210,
"temperatureMetric1": 0.1,
"temperatureMetric2": 0.1
},
"measurement1": 0.1,
"measurement2": 0.1
},
"atmosphere": [
{
"compound": "CO2",
"percentage": 95.3,
"atmosphericData1": "string",
"atmosphericData2": "string"
}
],
"discoveredAt": "1610-01-07T00:00:00.000Z",
"image": "https://cdn.scalar.com/photos/mars.jpg",
"satellites": [
{
"name": "Phobos",
"description": "Phobos is the larger and innermost of the two moons of Mars.",
"diameter": 22.2,
"type": "moon",
"orbit": {
"planet": {
"name": "Mars",
"description": "The red planet",
"type": "terrestrial",
"habitabilityIndex": 0.68,
"physicalProperties": {
"mass": 0.107,
"radius": 0.532,
"gravity": 0.378,
"temperature": {
"min": 130,
"max": 308,
"average": 210,
"temperatureMetric1": 0.1,
"temperatureMetric2": 0.1
},
"measurement1": 0.1,
"measurement2": 0.1
},
"atmosphere": [
{
"compound": "CO2",
"percentage": 95.3,
"atmosphericData1": "string",
"atmosphericData2": "string"
}
],
"discoveredAt": "1610-01-07T00:00:00.000Z",
"image": "https://cdn.scalar.com/photos/mars.jpg",
"satellites": [],
"creator": {
"name": "Marc"
},
"tags": [
"solar-system",
"rocky",
"explored"
],
"successCallbackUrl": "https://example.com/webhook",
"failureCallbackUrl": "https://example.com/webhook"
},
"orbitalPeriod": 0.319,
"distance": 9376
}
}
],
"creator": {
"name": "Marc"
},
"tags": [
"solar-system",
"rocky",
"explored"
],
"successCallbackUrl": "https://example.com/webhook",
"failureCallbackUrl": "https://example.com/webhook"
}"""))
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Example Responses
{
"id": 1,
"name": "Mars",
"description": "The red planet",
"type": "terrestrial",
"habitabilityIndex": 0.68,
"physicalProperties": {
"mass": 0.107,
"radius": 0.532,
"gravity": 0.378,
"temperature": {
"min": 130,
"max": 308,
"average": 210,
"temperatureMetric1": 0.1,
"temperatureMetric2": 0.1
},
"measurement1": 0.1,
"measurement2": 0.1
},
"atmosphere": [
{
"compound": "CO2",
"percentage": 95.3,
"atmosphericData1": "string",
"atmosphericData2": "string"
}
],
"discoveredAt": "1610-01-07T00:00:00.000Z",
"image": "https://cdn.scalar.com/photos/mars.jpg",
"satellites": [
{
"id": 1,
"name": "Phobos",
"description": "Phobos is the larger and innermost of the two moons of Mars.",
"diameter": 22.2,
"type": "moon",
"orbit": {
"planet": {
"id": 1,
"name": "Mars",
"description": "The red planet",
"type": "terrestrial",
"habitabilityIndex": 0.68,
"physicalProperties": {
"mass": 0.107,
"radius": 0.532,
"gravity": 0.378,
"temperature": {
"min": 130,
"max": 308,
"average": 210,
"temperatureMetric1": 0.1,
"temperatureMetric2": 0.1
},
"measurement1": 0.1,
"measurement2": 0.1
},
"atmosphere": [
{
"compound": "CO2",
"percentage": 95.3,
"atmosphericData1": "string",
"atmosphericData2": "string"
}
],
"discoveredAt": "1610-01-07T00:00:00.000Z",
"image": "https://cdn.scalar.com/photos/mars.jpg",
"satellites": [],
"creator": {
"id": 1,
"name": "Marc"
},
"tags": [
"solar-system",
"rocky",
"explored"
],
"lastUpdated": "2024-01-15T14:30:00.000Z",
"successCallbackUrl": "https://example.com/webhook",
"failureCallbackUrl": "https://example.com/webhook"
},
"orbitalPeriod": 0.319,
"distance": 9376
}
}
],
"creator": {
"id": 1,
"name": "Marc"
},
"tags": [
"solar-system",
"rocky",
"explored"
],
"lastUpdated": "2024-01-15T14:30:00.000Z",
"successCallbackUrl": "https://example.com/webhook",
"failureCallbackUrl": "https://example.com/webhook"
}{
"type": "https://example.com/errors/bad-request",
"title": "Bad Request",
"status": 400,
"detail": "The request was invalid."
}{
"type": "https://example.com/errors/forbidden",
"title": "Forbidden",
"status": 403,
"detail": "You are not authorized to access this resource."
}{
"type": "https://example.com/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "The resource you are trying to access does not exist."
}