SpaceDB API

Get a planet

get

Path Parameters

idintegerrequired

Response

application/json

Planet details

dataobject
Show Child Parameters
get/planets/{id}
 
application/json

Replace a planet

put

Path Parameters

idintegerrequired

Body

application/json

Planet

idinteger

Example:3

namestring

Example:Earth

typestring

Allowed values:terrestrialgas_giantice_giantdwarf

Example:terrestrial

star_idinteger | null

Example:1

mass_earthnumber | null(float)

Example:1

radius_kmnumber | null(float)

Example:6371

orbital_period_daysnumber | null(float)

Example:365.25

distance_aunumber | null(float)

Example:1

has_ringsboolean

Example:false

discovered_atstring | null(date)

Example:null

moon_countinteger

Example:1

created_atstring(date-time)
updated_atstring(date-time)

Response

Updated

put/planets/{id}

Body

{}
 

Partially update a planet

patch

Path Parameters

idintegerrequired

Body

application/json

Planet

idinteger

Example:3

namestring

Example:Earth

typestring

Allowed values:terrestrialgas_giantice_giantdwarf

Example:terrestrial

star_idinteger | null

Example:1

mass_earthnumber | null(float)

Example:1

radius_kmnumber | null(float)

Example:6371

orbital_period_daysnumber | null(float)

Example:365.25

distance_aunumber | null(float)

Example:1

has_ringsboolean

Example:false

discovered_atstring | null(date)

Example:null

moon_countinteger

Example:1

created_atstring(date-time)
updated_atstring(date-time)

Response

Updated

patch/planets/{id}

Body

{}
 

Delete a planet

delete

Path Parameters

idintegerrequired

Response

Deleted

delete/planets/{id}
 

List all moons

get

Query Parameters

pageinteger
per_pageinteger

<= 100

Response

application/json

Paginated list of moons

dataarray[object]
Show Child Parameters
linksobject
Show Child Parameters
metaobject
Show Child Parameters
get/moons
 
application/json