Skip to content

s3.php

S3 storage management module: creating and deleting accounts, managing buckets and files, obtaining usage statistics, managing pricing plans and billing.

API Methods

Method Action Description
create_account create S3 account/order Creates a new S3 storage account based on a selected plan, validates bucket name, and processes billing.
create_bucket create bucket Creates a new S3 bucket with specified configuration.
create_order create order Creates a new S3 storage order, provisions an S3 user account, and creates a bucket.
delete_account delete account Deletes an S3 account associated with a specific bucket name and region.
delete_bucket delete bucket Deletes a specified S3 bucket from the storage system.
delete_file delete file Deletes a specific file from S3 storage. Requires valid authentication token and appropriate permissions.
delete_payment_account delete payment account Deletes a specific S3 payment account associated with a bucket.
get_buckets get buckets Retrieves a list of S3 buckets for the authenticated user, including usage statistics and snapshot information.
get_buckets_rmq get buckets rmq Retrieves detailed information about S3 buckets, including usage statistics, metering history, billing info, and access credentials for a specific S3 user.
get_files get files Retrieves a list of files from S3 storage based on provided parameters.
get_users get users Retrieves a list of users associated with S3 storage configurations.
history get history Retrieves the history of S3 operations or access logs based on provided filters.
list_plans get list of S3 plans Returns a list of available S3 storage plans, including pricing and location information.
show_key get s3 key Retrieves S3 access credentials or configuration for a specific bucket/account.

s3/cancel_payment_account_deletion

Cancels the scheduled deletion of an S3 storage account associated with a specific client.

HTTP Method: POST

Parameters:

Parameter Required Type Description
token string Authentication token for the request
ip string Client IP address
params[client_id] integer The ID of the client whose account deletion is to be cancelled

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "token=HOSTKEY_TOKEN" \
--data "params[client_id]=12345"
Example of a successful response
{
"result": "OK",
"action": "cancel_payment_account_deletion",
"data": {
"client_id": 12345,
"status": "cancelled",
"message": "Account deletion scheduled for this client has been successfully cancelled."
}
}
Failure response
{
"code": -1,
"message": "Client not found or already deleted"
}

s3/create_account

Creates a new S3 storage account based on a selected plan, validates bucket name, and processes billing.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string The action to perform (must be create_order for account creation)
token string Authentication token
params[bucket_name] string The desired bucket name
params[plan_id] integer ID of the S3 plan to subscribe to
params[location] string Storage location code (e.g., NL)

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "action=create_order" \
--data "token=YOUR_TOKEN" \
--data "params[bucket_name]=my-awesome-bucket" \
--data "params[plan_id]=123" \
--data "params[location]=NL"
Example of a successful response
{
"result": "OK",
"action": "create_order",
"s3uid": 12345
}
Failure response
{
"code": -1,
"message": "S3 account was created, but have error: Error message. Debug data: ..."
}

s3/create_bucket

Creates a new S3 bucket with specified configuration.

HTTP Method: POST

Parameters:

Parameter Required Type Description
token string Authentication token for the API request.
params[bucket_name] string The unique name of the S3 bucket to be created.

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "token=HOSTKEY_TOKEN" \
--data "params[bucket_name]=VALUE"
Example of a successful response
{
"status": 200,
"body": "XML or JSON response from S3 provider",
"error": null
}
Failure response
{
"code": -1,
"message": "Bucket name already exists or is invalid"
}

s3/create_order

Creates a new S3 storage order, provisions an S3 user account, and creates a bucket.

HTTP Method: POST

Parameters:

Parameter Required Type Description
token string Authentication token for the request.
params[plan_id] int The ID of the S3 plan to subscribe to.
params[bucket_name] string The name of the bucket to be created.
params[location] string The location code where the storage will be provisioned. Must match one of the plan's allowed locations.

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "token=HOSTKEY_TOKEN" \
--data "params[plan_id]=VALUE" \
--data "params[bucket_name]=VALUE" \
--data "params[location]=VALUE"
Example of a successful response
{
"result": "OK",
"action": "create_order",
"s3uid": "abc123def456ghi789jklmno"
}
Failure response
{
"code": -1,
"message": "S3 account was created, but have error: [error_details]. Debug data: [debug_info]."
}

s3/delete_account

Deletes an S3 account associated with a specific bucket name and region.

HTTP Method: POST

Parameters:

Parameter Required Type Description
token string Authentication token for the request
params[bucket_name] string The name of the S3 bucket to delete
params[region] string The region associated with the bucket

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "token=HOSTKEY_TOKEN" \
--data "params[bucket_name]=example-bucket" \
--data "params[region]=us-east-1"
Example of a successful response
{
"result": "OK",
"action": "delete_account",
"data": {
"status": "deleted",
"bucket_name": "example-bucket",
"region": "us-east-1"
},
"deleted_at": "2024-01-15T10:30:00Z",
"service_period_end": null,
"service_status": null
}
Failure response
{
"code": -1,
"message": "Bucket not found or access denied"
}

s3/delete_bucket

Deletes a specified S3 bucket from the storage system.

HTTP Method: POST

Parameters:

Parameter Required Type Description
token string Authentication token for API access.
params[bucket_name] string The name of the S3 bucket to be deleted.

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "token=HOSTKEY_TOKEN" \
--data "params[bucket_name]=VALUE"
Example of a successful response
{
"result": "OK",
"action": "delete_bucket",
"data": {}
}
Failure response
{
"code": -1,
"message": "Bucket not found or access denied"
}

s3/delete_file

Deletes a specific file from S3 storage. Requires valid authentication token and appropriate permissions.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: delete_file
token string Authentication token for the request.
params[file_path] string The full path of the file to be deleted in the S3 bucket.

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "action=delete_file" \
--data "token=HOSTKEY_TOKEN" \
--data "params[file_path]=VALUE"
Example of a successful response
{
"result": "OK",
"action": "delete_file",
"data": {
"status": "deleted",
"path": "/uploads/example_file.zip"
}
}
Failure response
{
"code": -1,
"message": "Access denied"
}

s3/delete_payment_account

Deletes a specific S3 payment account associated with a bucket.

HTTP Method: POST

Parameters:

Parameter Required Type Description
token string Authentication token for the request
ip string Client IP address
params[bucket_name] string The name of the S3 bucket to process

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "token=HOSTKEY_TOKEN" \
--data "params[bucket_name]=example-bucket"
Example of a successful response
{
"result": "OK",
"action": "delete_payment_account",
"data": {
"status": "deleted",
"bucket_name": "example-bucket"
}
}
Failure response
{
"code": -1,
"message": "Bucket not found or access denied"
}

s3/get_buckets

Retrieves a list of S3 buckets for the authenticated user, including usage statistics and snapshot information.

HTTP Method: POST|GET

Parameters:

Parameter Required Type Description
action string The action to perform (get_buckets)
token string Authentication token
s3uid string The S3 user ID of the account to list buckets for

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST|GET \
--data "action=get_buckets" \
--data "token=HOSTKEY_TOKEN" \
--data "s3uid=VALUE"
Example of a successful response
{
"result": "OK",
"action": "get_buckets",
"message": [
{
"Name": "example-bucket-name",
"CreationDate": "2024-01-15T10:30:00Z"
}
],
"bandwidth": 1024,
"snapshot": {
"bandwidth_usage": 512,
"storage_usage": 1024,
"created_at": "2024-01-15T10:30:00Z"
}
}
Failure response
{
"code": -1,
"message": "S3 account not found for this customer"
}

s3/get_buckets_rmq

Retrieves detailed information about S3 buckets, including usage statistics, metering history, billing info, and access credentials for a specific S3 user.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: get_buckets_rmq
token string Authentication token
ip string Client IP address
s3uid integer The unique identifier of the S3 user/account

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "action=get_buckets_rmq" \
--data "token=HOSTKEY_TOKEN" \
--data "s3uid=12345"
Example of a successful response
{
"result": "OK",
"action": "get_buckets_rmq",
"message": [
{
"name": "bucket-name-1",
"usage": 1024
},
{
"name": "bucket-name-2",
"usage": 2048
}
],
"usage_storage": 3072,
"quota": 5120,
"metering": [
{
"date": "2024-05-01",
"traffic_gb": 1.5,
"storage_gb": 10.2
}
],
"billing": {
"service_id": 123,
"currency": "EUR",
"period": {
"start": "2024-05-01T00:00:00Z",
"end": "2024-06-01T00:00:00Z"
},
"limits": {
"traffic_gb": 100.0,
"storage_gb": 500
},
"current_period": {
"traffic_used_gb": 5.5,
"storage_used_gb": 45.2,
"billed_traffic_gb": 5.5,
"billed_storage_gb": 45.2,
"billed_traffic_amount": 10.5,
"billed_storage_amount": 45.2
},
"overage": null,
"records": [],
"error": "billing_unavailable"
},
"access_key": "AKIAEXAMPLE123",
"secret_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"endpoint": "s3.region-code.amazonaws.com"
}
Failure response
{
"code": -1,
"message": "S3 account not found for this customer"
}

s3/get_files

Retrieves a list of files from S3 storage based on provided parameters.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: get_files
token string Authentication token for API access.
ip string Client IP address used for authentication validation.

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "action=get_files" \
--data "token=HOSTKEY_TOKEN"
Example of a successful response
{
"result": "OK",
"action": "get_files",
"data": [
{
"name": "file_name.ext",
"size": 1024,
"last_modified": "2024-05-20T12:00:00Z",
"etag": "d41d8cd98f00b204e9800998ecf8427e"
}
]
}
Failure response
{
"code": -1,
"message": "Authentication failed or invalid token."
}

s3/get_users

Retrieves a list of users associated with S3 storage configurations.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: get_users
token string Authentication token for API access.
customer_id integer ID of the customer to filter by.
plan_id integer ID of the plan to filter by.
s3uid string S3 UID to search for (partial match).
email string Email address to filter by (partial match).
billing string Billing location code.
get_all boolean If true, skips filtering and returns all users.
limit integer Maximum number of records to return.
storage_type string Storage type (e.g., Standard).
include_deleted boolean Whether to include deleted users.
region string Region code for filtering.

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "action=get_users" \
--data "token=HOSTKEY_TOKEN"
Example of a successful response
{
"result": "OK",
"action": "get_users",
"data": [
{
"id": 1024,
"name": "[email protected]",
"status": "active",
"billing_location": "NL",
"contractnum": "C12345"
}
]
}
Failure response
{
"code": -1,
"message": "Access denied"
}

s3/history

Retrieves the history of S3 operations or access logs based on provided filters.

HTTP Method: POST

Parameters:

Parameter Required Type Description
token string Authentication token for API access
ip string Client IP address for validation

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "token=HOSTKEY_TOKEN"
Example of a successful response
{
"result": "OK",
"action": "history",
"data": [
{
"id": 1024,
"event": "bucket_created",
"bucket_name": "my-storage-bucket",
"region": "us-east-1",
"user_id": 55,
"timestamp": "2024-03-20T14:30:00Z",
"ip": "192.168.1.1"
},
{
"id": 1025,
"event": "policy_changed",
"bucket_name": "my-storage-bucket",
"region": "us-east-1",
"user_id": 55,
"timestamp": "2024-03-21T09:15:00Z",
"ip": "192.168.1.1"
}
]
}
Failure response
{
"code": -1,
"message": "Unauthorized access or invalid token"
}

s3/list_plans

Returns a list of available S3 storage plans, including pricing and location information.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: list_plans
token string Authentication token for the API request.

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "action=list_plans" \
--data "token=HOSTKEY_TOKEN"
Example of a successful response
{
"result": "OK",
"action": "list_plans",
"data": [
{
"id": 1,
"name": "Standard S3 Plan",
"description": "High availability storage plan",
"location": "NL",
"price": {
"EUR": 5.0,
"USD": 5.45,
"RUB": 500.0
},
"active": true,
"storage_gb": 100,
"transfer_limit": "unlimited",
"tags": []
}
]
}
Failure response
{
"code": -1,
"message": "Invalid authentication token"
}

s3/show_key

Retrieves S3 access credentials or configuration for a specific bucket/account.

HTTP Method: POST

Parameters:

Parameter Required Type Description
token string Authentication token for the request.
params[bucket_name] string The name of the S3 bucket to retrieve keys for.

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "action=show_key" \
--data "token=HOSTKEY_TOKEN" \
--data "params[bucket_name]=VALUE"
Example of a successful response
{
"result": "OK",
"action": "show_key",
"data": {
"access_key_id": "AKIAIOSFODNN7EXAMPLE",
"secret_access_key": "wJalrXUtnFEMI/KxvMhaiwvTh6EIKpS5g",
"region": "us-east-1",
"bucket_name": "my-secure-bucket",
"storage_type": "standard"
}
}
Failure response
{
"code": -1,
"message": "Access denied or bucket not found"
}

s3/tariff_upgrade

Upgrades the S3 storage tariff for a specific service or account.

HTTP Method: POST

Parameters:

Parameter Required Type Description
token string Authentication token for API access.
params[service_id] int The unique identifier of the service to upgrade.
params[new_tariff_id] int The ID of the new tariff plan to apply.

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "token=HOSTKEY_TOKEN" \
--data "params[service_id]=12345" \
--data "params[new_tariff_id]=102"
Example of a successful response
{
"result": "OK",
"action": "tariff_upgrade",
"data": {
"service_id": 12345,
"old_tariff_id": 101,
"new_tariff_id": 102,
"status": "active",
"updated_at": "2024-05-20T14:30:00Z"
}
}
Failure response
{
"code": -1,
"message": "Invalid service ID or tariff not found"
}

s3/update_traffic_info

Updates traffic usage information or configuration for a specific S3 bucket/account.

HTTP Method: POST

Parameters:

Parameter Required Type Description
token string Authentication token for the request.
params[bucket_name] string The name of the S3 bucket to update.
params[region] string The AWS region for the bucket (e.g., us-east-1).
params[storage_type] string The type of storage being used.

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "token=HOSTKEY_TOKEN" \
--data "params[bucket_name]=my-storage-bucket"
Example of a successful response
{
"result": "OK",
"action": "update_traffic_info",
"data": {
"status": "updated",
"bucket_name": "my-storage-bucket",
"region": "us-east-1"
}
}
Failure response
{
"code": -1,
"message": "Error updating traffic information"
}
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×