跳至內容
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"
}