コンテンツへスキップ
Fumadocs

Upload an image to a planet

POST
/planets/{planetId}/image

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

認可

header認可Bearer <token>

JWT Bearer token authentication

パスパラメーター

planetId*integer

The ID of the planet to get

フォーマットint64

リクエストボディ

Image to upload

multipart/form-data
  1. body
image?file

The image file to upload

フォーマットbinary

レスポンスボディ

Image uploaded

  1. response

Message about an image upload

message?string
imageUrl?string

The URL where the uploaded image can be accessed

uploadedAt?string

Timestamp when the image was uploaded

フォーマットdate-time
fileSize?integer

Size of the uploaded image in bytes

mimeType?string

The content type of the uploaded image

リクエスト例
curl -X POST 'https://galaxy.scalar.com/planets/1/image'
レスポンス例
{
  "message": "Image uploaded successfully",
  "imageUrl": "https://cdn.scalar.com/images/8f47c132-9d1f-4f83-b5a4-91db5ee757ab.jpg",
  "uploadedAt": "2024-01-15T14:30:00Z",
  "fileSize": 1048576,
  "mimeType": "image/jpeg"
}