Skip to content

Media Library API Documentation

Media library management endpoints for uploading, browsing, and managing media files and folders.

Browse Media Library

POST /api.php

DEPRECATION WARNING

This endpoint is deprecated and will be removed in a future Octeth release. There are no alternative or replacement API endpoints available.

API Usage Notes

  • Authentication required: User API Key
  • Required permissions: Media.Browse
  • Legacy endpoint access via /api.php only (no v1 REST alias configured)

Browse media library files and folders in a specified folder.

Request Body Parameters:

ParameterTypeRequiredDescription
CommandStringYesAPI command: media.browse
SessionIDStringNoSession ID obtained from login
APIKeyStringNoAPI key for authentication
FolderIDIntegerNoParent folder ID to browse (default: 0 = root)
bash
curl -X POST https://example.com/api.php \
  -H "Content-Type: application/json" \
  -d '{
    "Command": "media.browse",
    "SessionID": "your-session-id",
    "FolderID": 0
  }'
json
{
  "Success": true,
  "ErrorCode": 0,
  "ErrorText": "",
  "Folders": [
    {
      "ID": 123,
      "Name": "My Folder",
      "ParentFolderID": 0
    }
  ],
  "Files": [
    {
      "ID": 456,
      "Name": "image.jpg",
      "URL": "https://cdn.example.com/media/abc123"
    }
  ]
}
json
{
  "Success": false,
  "ErrorCode": [1]
}
txt
0: Success

Delete Media File

POST /api.php

DEPRECATION WARNING

This endpoint is deprecated and will be removed in a future Octeth release. There are no alternative or replacement API endpoints available.

API Usage Notes

  • Authentication required: User API Key or Admin API Key
  • Required permissions: Media.Delete
  • Legacy endpoint access via /api.php only (no v1 REST alias configured)

Delete a media file from the media library.

Request Body Parameters:

ParameterTypeRequiredDescription
CommandStringYesAPI command: media.delete
SessionIDStringNoSession ID obtained from login
APIKeyStringNoAPI key for authentication
MediaIDIntegerYesID of the media file to delete
bash
curl -X POST https://example.com/api.php \
  -H "Content-Type: application/json" \
  -d '{
    "Command": "media.delete",
    "SessionID": "your-session-id",
    "MediaID": 456
  }'
json
{
  "Success": true,
  "ErrorCode": 0
}
json
{
  "Success": false,
  "ErrorCode": [1]
}
txt
0: Success
1: Missing required parameter: MediaID
2: Media file not found or permission denied

Create Media Library Folder

POST /api.php

DEPRECATION WARNING

This endpoint is deprecated and will be removed in a future Octeth release. There are no alternative or replacement API endpoints available.

API Usage Notes

  • Authentication required: User API Key
  • Required permissions: Media.Upload
  • Legacy endpoint access via /api.php only (no v1 REST alias configured)

Create a new folder in the media library.

Request Body Parameters:

ParameterTypeRequiredDescription
CommandStringYesAPI command: media.foldercreate
SessionIDStringNoSession ID obtained from login
APIKeyStringNoAPI key for authentication
FolderNameStringYesName of the folder to create
ParentFolderIDIntegerYesParent folder ID (use 0 for root level)
bash
curl -X POST https://example.com/api.php \
  -H "Content-Type: application/json" \
  -d '{
    "Command": "media.foldercreate",
    "SessionID": "your-session-id",
    "FolderName": "My Images",
    "ParentFolderID": 0
  }'
json
{
  "Success": true,
  "ErrorCode": 0,
  "FolderID": 789
}
json
{
  "Success": false,
  "ErrorCode": [1, 2]
}
txt
0: Success
1: Missing required parameter: FolderName
2: Missing required parameter: ParentFolderID
3: Parent folder not found

Delete Media Library Folder

POST /api.php

DEPRECATION WARNING

This endpoint is deprecated and will be removed in a future Octeth release. There are no alternative or replacement API endpoints available.

API Usage Notes

  • Authentication required: User API Key
  • Required permissions: Media.Delete
  • Legacy endpoint access via /api.php only (no v1 REST alias configured)

Delete a folder and all its contents (files and subfolders) from the media library.

Request Body Parameters:

ParameterTypeRequiredDescription
CommandStringYesAPI command: media.folderdelete
SessionIDStringNoSession ID obtained from login
APIKeyStringNoAPI key for authentication
FolderIDIntegerYesID of the folder to delete
bash
curl -X POST https://example.com/api.php \
  -H "Content-Type: application/json" \
  -d '{
    "Command": "media.folderdelete",
    "SessionID": "your-session-id",
    "FolderID": 789
  }'
json
{
  "Success": true,
  "ErrorCode": 0
}
json
{
  "Success": false,
  "ErrorCode": [1]
}
txt
0: Success
1: Missing required parameter: FolderID
2: Folder not found
3: Permission denied (folder does not belong to user)

Retrieve Media File Details

POST /api.php

DEPRECATION WARNING

This endpoint is deprecated and will be removed in a future Octeth release. There are no alternative or replacement API endpoints available.

API Usage Notes

  • Authentication required: User API Key
  • Required permissions: Media.Retrieve
  • Legacy endpoint access via /api.php only (no v1 REST alias configured)

Retrieve details of a specific media file from the media library.

Request Body Parameters:

ParameterTypeRequiredDescription
CommandStringYesAPI command: media.retrieve
SessionIDStringNoSession ID obtained from login
APIKeyStringNoAPI key for authentication
MediaIDIntegerYesID of the media file to retrieve
bash
curl -X POST https://example.com/api.php \
  -H "Content-Type: application/json" \
  -d '{
    "Command": "media.retrieve",
    "SessionID": "your-session-id",
    "MediaID": 456
  }'
json
{
  "Success": true,
  "ErrorCode": 0,
  "Name": "image.jpg",
  "Type": "image/jpeg",
  "Size": 102400,
  "URL": "https://cdn.example.com/media/abc123"
}
json
{
  "Success": false,
  "ErrorCode": [1]
}
txt
0: Success
1: Missing required parameter: MediaID
2: Media file not found

Upload Media File

POST /api.php

DEPRECATION WARNING

This endpoint is deprecated and will be removed in a future Octeth release. There are no alternative or replacement API endpoints available.

API Usage Notes

  • Authentication required: User API Key
  • Required permissions: Media.Upload
  • Legacy endpoint access via /api.php only (no v1 REST alias configured)

Upload a new media file to the media library.

Request Body Parameters:

ParameterTypeRequiredDescription
CommandStringYesAPI command: media.upload
SessionIDStringNoSession ID obtained from login
APIKeyStringNoAPI key for authentication
MediaDataStringYesBase64-encoded file data
MediaTypeStringYesMIME type of the file (e.g., "image/jpeg")
MediaSizeIntegerYesFile size in bytes
MediaNameStringYesFile name
bash
curl -X POST https://example.com/api.php \
  -H "Content-Type: application/json" \
  -d '{
    "Command": "media.upload",
    "SessionID": "your-session-id",
    "MediaData": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
    "MediaType": "image/png",
    "MediaSize": 68,
    "MediaName": "sample.png"
  }'
json
{
  "Success": true,
  "ErrorCode": 0,
  "MediaID": 456
}
json
{
  "Success": false,
  "ErrorCode": [1, 2, 3, 5]
}
txt
0: Success
1: Missing required parameter: MediaData
2: Missing required parameter: MediaType
3: Missing required parameter: MediaSize
4: File size exceeds maximum allowed limit
5: Missing required parameter: MediaName

Any questions? Contact us.