Skip to main content

Image Storage API

A simple and secure API for storing, processing, and accessing images with token-based authentication. Project: Image Storage

Accessing Images

Access images in three formats:

  • Original Image: https://images.alifm.net/{image_id}.jpg
  • Thumbnail Image: https://images.alifm.net/{image_id}_thumb.png
  • WebP Image: https://images.alifm.net/{image_id}_min.webp

Example URLs

  • Original Image: https://images.alifm.net/cO3Qvq5BCeMPhsxS.jpg
  • Thumbnail Image: https://images.alifm.net/cO3Qvq5BCeMPhsxS_thumb.png
  • WebP Image: https://images.alifm.net/cO3Qvq5BCeMPhsxS_min.webp

If your project is private, access requires a Temporary Image Token.

Authorization

All endpoints require a Bearer token.

Uploading an Image

Endpoint

Method: POST

https://images.alifm.net/api/upload

Request

  • Content Type: multipart/form-data
  • Field: image (The image file to upload)

Example Request

curl -X POST "https://images.alifm.net/api/upload" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-F "image=@path/to/image.jpg"

Example Response

{
"message": "Image uploaded successfully",
"id": "a9e0be6a-e3b4-4745-ba57-105566a6ea54",
"image": {
"ori": "https://images.alifm.net/cO3Qvq5BCeMPhsxS.jpg",
"thumb": "https://images.alifm.net/cO3Qvq5BCeMPhsxS_thumb.png",
"webp": "https://images.alifm.net/cO3Qvq5BCeMPhsxS_min.webp"
},
"created_at": "2025-02-04 20:17:00"
}

Getting a Temporary Image Token

Endpoint

Method: POST

https://images.alifm.net/api/show

Request

  • Field: id (The image ID to access)

Example Request

curl -X POST "https://images.alifm.net/api/show" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d "id=a9e0be6a-e3b4-4745-ba57-105566a6ea54"

Example Response

{
"message": "Temporary image links generated successfully",
"token": "0QS27vE6beT4cFLf5fad",
"image": {
"ori": "https://images.alifm.net/BAZdaE7l50TpCa6W.jpg?token=0QS27vE6beT4cFLf5fad",
"thumb": "https://images.alifm.net/BAZdaE7l50TpCa6W_thumb.png?token=0QS27vE6beT4cFLf5fad",
"webp": "https://images.alifm.net/BAZdaE7l50TpCa6W_min.webp?token=0QS27vE6beT4cFLf5fad"
}
}

Deleting an Image

Endpoint

Method: DELETE

https://images.alifm.net/api/delete

Request

  • Field: id (The image ID to delete)

Example Request

curl -X DELETE "https://images.alifm.net/api/delete" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d "id=a9e0be6a-e3b4-4745-ba57-105566a6ea54"

Example Response

{
"message": "Image deleted successfully",
"id": "a9e0be6a-e3b4-4745-ba57-105566a6ea54"
}