Ga naar inhoud

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 account based on the selected pricing plan, checks free account limits and user credits, and creates an order in the billing system.
create_bucket create S3 bucket Creates a new S3 bucket for an existing user account. Requires an active s3uid belonging to the client.
create_order create S3 account order Creates a new S3 account (bucket) for the user, links it to a pricing plan, and places an order in the billing system.
delete_account delete account Deletes the user's S3 account, cancels associated services, and performs action auditing.
delete_bucket delete S3 bucket Deletes the specified S3 bucket after verifying its ownership by the user and its presence in the list of available buckets.
delete_file delete file Deletes the specified file from the S3 bucket. Requires a valid s3uid of the account owner.
delete_payment_account delete payment account Requests subscription cancellation and S3 account deletion. If successful, the service is moved to cancellation status.
get_buckets get buckets list Returns a list of S3 buckets, traffic information, and snapshots for the specified account.
get_buckets_rmq get bucket info via RMQ Returns the user's bucket list, storage usage information, billing data, and S3 access credentials.
get_files get files in bucket Returns a list of files and folders in the specified S3 bucket with pagination support via continuation token.
get_users get S3 users list Returns a list of S3 accounts with detailed information on plans, traffic, and storage usage. Supports filtering by plan_id, email, s3uid, billing, and location.
history get S3 event history Returns the action history associated with a specific ID (likely an account or user).
list_plans get plans list Returns a list of available S3 plans including VAT rate and user currency. For administrators, it can return a specific plan by ID.
show_key get access keys Returns the decrypted secret key or public access key for the specified account.

s3/cancel_payment_account_deletion

Cancels the S3 account deletion process initiated via a deletion request. Restores the service status.

HTTP-method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: cancel_payment_account_deletion
token string Authorization token
s3uid string Unique S3 account identifier

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "action=cancel_payment_account_deletion" \
--data "token=HOSTKEY_TOKEN" \
--data "s3uid=VALUE"
Example of a successful response
{
"result": "OK",
"action": "cancel_payment_account_deletion",
"cancellation_date": "2024-12-31",
"next_commit_date": "2025-01-01",
"termination_date": "2025-01-01"
}
Failure response

``` { "code": -1, "message": "S3 account not found for this customer" }

```

s3/create_account

Creates a new S3 account based on the selected pricing plan, checks free account limits and user credits, and creates an order in the billing system.

HTTP-method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: create_account
token string Authorization token
bucket_name string Bucket name for account creation
plan_id int ID of the selected pricing plan
location string Deployment location (region)

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "action=create_account" \
--data "token=HOSTKEY_TOKEN" \
--data "bucket_name=my-new-bucket" \
--data "plan_id=123" \
--data "location=us-east-1"
Example of a successful response
{
"result": "OK",
"action": "create_account",
"s3uid": "5f8e9d2a1b3c4d5e6f7g8h9i0j1k2l3m"
}
Failure response

``` { "code": -1, "message": "S3 account was being created, however a bucket creation error occurred - [error_details]" }

```

s3/create_bucket

Creates a new S3 bucket for an existing user account. Requires an active s3uid belonging to the client.

HTTP-method: POST

Parameters:

Parameter Required Type Description
action string Method action
token string Authorization token
s3uid string Unique S3 account identifier (s3uid)
bucket_name string Name of the bucket being created

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "action=create_bucket" \
--data "token=YOUR_TOKEN" \
--data "s3uid=YOUR_S3UID" \
--data "bucket_name=my-new-bucket"
Example of a successful response
{
"result": "OK",
"action": "create_bucket",
"message": {
"status": "success",
"bucket_name": "my-new-bucket"
}
}
Failure response

``` { "code": -1, "message": "S3 account not found for this customer" }

```

s3/create_order

Creates a new S3 account (bucket) for the user, links it to a pricing plan, and places an order in the billing system.

HTTP-method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: create_order
token string Authorization token
bucket_name string Name of the bucket being created
plan_id int ID of the selected pricing plan
location string Data storage location (region). Default is NL.

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "action=create_order" \
--data "token=HOSTKEY_TOKEN" \
--data "bucket_name=VALUE" \
--data "plan_id=VALUE"
Example of a successful response
{
"result": "OK",
"action": "create_order",
"s3uid": "5f8e9d2a1b0c4e3f7a6b5d4c3e2f1a0b"
}
Failure response

``` { "code": -1, "message": "S3 account was being created, but a bucket creation error occurred - [error]" }

```

s3/delete_account

Deletes the user's S3 account, cancels associated services, and performs action auditing.

HTTP-method: POST

Parameters:

Parameter Required Type Description
token string Authorization token
id integer User ID (for administrator)
s3uid string Unique S3 account identifier
reason string Reason for account deletion

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "token=HOSTKEY_TOKEN" \
--data "s3uid=VALUE"
Example of a successful response
{
"result": "OK",
"action": "delete_account",
"deleted_at": "2024-05-20 14:30:00",
"service_status": "cancelled",
"service_period_end": "2024-05-20 14:30:00"
}
Failure response

``` { "code": -1, "message": "S3 account not found for this customer" }

```

s3/delete_bucket

Deletes the specified S3 bucket after verifying its ownership by the user and its presence in the list of available buckets.

HTTP-method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: delete_bucket
token string Authorization token
s3uid string Unique S3 account identifier
bucket_name string Name of the bucket being deleted

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "action=delete_bucket" \
--data "token=HOSTKEY_TOKEN" \
--data "s3uid=VALUE" \
--data "bucket_name=VALUE"
Example of a successful response
{
"result": "OK",
"action": "delete_bucket",
"message": "Bucket deleted successfully"
}
Failure response

``` { "code": -1, "message": "Delete S3 bucket error: Bucket not found or access denied" }

```

s3/delete_file

Deletes the specified file from the S3 bucket. Requires a valid s3uid of the account owner.

HTTP-method: POST

Parameters:

Parameter Required Type Description
token string Authorization token
s3uid string Unique S3 account identifier
bucket_name string Bucket name
filename string Path or name of the file to be deleted

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "token=HOSTKEY_TOKEN" \
--data "s3uid=VALUE" \
--data "bucket_name=VALUE" \
--data "filename=VALUE"
Example of a successful response
{
"result": "OK",
"action": "delete_file",
"message": "string"
}
Failure response

``` { "code": -1, "message": "Delete S3 file error: {error}. Response: {response}" }

```

s3/delete_payment_account

Requests subscription cancellation and S3 account deletion. If successful, the service is moved to cancellation status.

HTTP-method: POST

Parameters:

Parameter Required Type Description
token string Authorization token
id integer User ID (for administrator)
s3uid string S3 account UID
reason string Reason for deletion/cancellation

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "token=HOSTKEY_TOKEN" \
--data "s3uid=VALUE"
Example of a successful response
{
"result": "OK",
"action": "delete_payment_account",
"cancellation_date": "2024-12-31",
"cancellation_date_origin": "31.12.2024",
"reason_suspend": "User requested cancellation"
}
Failure response

``` { "code": -1, "message": "S3 account not found for this customer" }

```

s3/get_buckets

Returns a list of S3 buckets, traffic information, and snapshots for the specified account.

HTTP-method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: get_buckets
token string Authorization token
id integer Client ID (for admin)
s3uid string User's S3 UID

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "action=get_buckets" \
--data "token=HOSTKEY_TOKEN" \
--data "s3uid=VALUE"
Example of a successful response
{
"result": "OK",
"action": "get_buckets",
"message": [
{
"Name": "my-bucket-name",
"usage": 1024,
"created_at": "2024-01-15T10:30:00Z"
}
],
"bandwidth": 512,
"quota": 5000,
"snapshot": {
"bandwidth_usage": 100,
"storage_usage": 500,
"created_at": "2024-05-20T12:00:00Z"
},
"metering": {},
"billing": {
"service_id": 123,
"currency": "EUR",
"period": {
"start": "2024-05-01T00:00:00Z",
"end": "2024-06-01T00:00:00Z"
},
"limits": {
"traffic_gb": 100,
"storage_gb": 500
},
"current_period": {
"traffic_used_gb": 10.5,
"storage_used_gb": 45.2,
"billed_traffic_gb": 0,
"billed_storage_gb": 0,
"billed_traffic_amount": 0,
"billed_storage_amount": 0
},
"overage": null,
"records": [],
"error": "billing_unavailable"
},
"access_key": "AKIAEXAMPLE123456789",
"secret_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"endpoint": "s3.eu-central-1.amazonaws.com"
}
Failure response

``` { "code": -1, "message": "S3 account not found for this customer" }

```

s3/get_buckets_rmq

Returns the user's bucket list, storage usage information, billing data, and S3 access credentials.

HTTP-method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: get_buckets_rmq
token string Authorization token
id int Client ID (for administrator)
s3uid string Unique S3 account identifier

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "action=get_buckets_rmq" \
--data "token=HOSTKEY_TOKEN" \
--data "s3uid=VALUE"
Example of a successful response
{
"result": "OK",
"action": "get_buckets_rmq",
"message": [
{
"name": "example-bucket",
"usage": 1024
},
{
"name": "test-bucket",
"usage": 512
}
],
"usage_storage": 1536,
"quota": 5000,
"metering": [
{
"date": "2024-05-01",
"traffic_gb": 10.5,
"storage_gb": 100
}
],
"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": 12.5,
"storage_used_gb": 45.0,
"billed_traffic_gb": 0,
"billed_storage_gb": 0,
"billed_traffic_amount": 0,
"billed_storage_amount": 0
},
"overage": null,
"records": [],
"error": "billing_unavailable"
},
"access_key": "AKIAIOSFODNN7EXAMPLE",
"secret_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"endpoint": "s3.nl.hostkey.com"
}
Failure response

``` { "code": -1, "message": "S3 account not found for this customer" }

```

s3/get_files

Returns a list of files and folders in the specified S3 bucket with pagination support via continuation token.

HTTP-method: POST|GET

Parameters:

Parameter Required Type Description
action string Method identifier: get_files
token string Authorization token
s3uid string Unique S3 account identifier
bucket_name string Bucket name
continuation_token string Token to retrieve the next page of results
max_keys int Maximum number of keys (up to 100)
search string Search by filename

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "action=get_files" \
--data "token=HOSTKEY_TOKEN" \
--data "s3uid=VALUE" \
--data "bucket_name=VALUE"
Example of a successful response
{
"result": "OK",
"action": "get_files",
"files": [
{
"key": "folder/file.txt",
"original_key": "folder/file.txt",
"size": 1024,
"last_modified": "2024-05-20T12:00:00Z"
}
],
"folders": [
{
"key": "folder/",
"original_key": "folder/"
}
],
"next_token": "abc123token"
}
Failure response

``` { "code": -1, "message": "$module/get_files: S3 account not found for this customer", "details": { "s3uid": "unknown_id" } }

```

s3/get_users

Returns a list of S3 accounts with detailed information on plans, traffic, and storage usage. Supports filtering by plan_id, email, s3uid, billing, and location.

HTTP-method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: get_users
token string Authorization token
id integer Client ID (for admin)
plan_id integer Pricing plan ID
s3uid string User's S3 UID
email string Search by email
billing string Billing method (e.g., whmcs_itb)
location string Location search
storage_type string Storage type (Standard/Cold)
period_from string Start date of the period for traffic calculation (Y-m-d)
period_to string End date of the period for traffic calculation (Y-m-d)
offset integer Pagination offset
limit integer Number of records per page
order string Sorting field (total_traffic_period_gb or total_storage_peak_gb)
order_by string Sort direction (ASC/DESC)

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",
"s3_users": [
{
"id": 123,
"s3uid": "abc-123-def",
"email": "[email protected]",
"billing": "whmcs_itb",
"region": "NL",
"price": {
"EUR": 49.99,
"USD": 55.00
},
"traffic": 12.5,
"storage_usage": 150.0,
"service": {
"id": 456,
"entity_id": 123,
"rate": 49.99,
"status": "active",
"period_start": "2024-01-01T00:00:00Z",
"period_end": "2025-01-01T00:00:00Z"
}
}
]
}
Failure response

``` { "code": -1, "message": "customer not found" }

```

s3/history

Returns the action history associated with a specific ID (likely an account or user).

HTTP-method: POST|GET

Parameters:

Parameter Required Type Description
action string Method identifier: history
id integer Entity ID to retrieve history (e.g., user's s3uid)
token string Authorization token

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "action=history" \
--data "id=VALUE" \
--data "token=HOSTKEY_TOKEN"
Example of a successful response
{
"result": "OK",
"action": "history",
"data": []
}
Failure response

``` { "code": -1, "message": "\(module/\)action: invalid token, logout" }

```

s3/list_plans

Returns a list of available S3 plans including VAT rate and user currency. For administrators, it can return a specific plan by ID.

HTTP-method: POST|GET

Parameters:

Parameter Required Type Description
action string Method identifier: list_plans
token string Authorization token
id int Specific plan ID (for administrators)

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",
"plans": [
{
"id": 1,
"name": "Standard Plan",
"active": 1,
"storage_type": "standard",
"location": "NL",
"price": {
"base_price": 10.0,
"EUR": 10.0,
"RUB": 950.0,
"USD": 11.0
},
"traffic_overage_price": {
"EUR": 0.05,
"RUB": 4.5,
"USD": 0.06
},
"storage_overage_price": {
"EUR": 0.01,
"RUB": 0.9,
"USD": 0.012
}
}
],
"vat": 1.2
}
Failure response

``` { "code": -1, "message": "S3 plan not found" }

```

s3/show_key

Returns the decrypted secret key or public access key for the specified account.

HTTP-method: POST|GET

Parameters:

Parameter Required Type Description
action string Method identifier: show_key
token string Authorization token
s3uid string Unique S3 account identifier
s3_key string Type of requested key (secret_key or access_key)

Example Request

curl -s "https://invapi.hostkey.com/s3.php" -X POST \
--data "action=show_key" \
--data "token=HOSTKEY_TOKEN" \
--data "s3uid=VALUE" \
--data "s3_key=VALUE"
Example of a successful response
{
"result": "OK",
"action": "show_key",
"key": "wJalrXUtnFEMI/K@7mwR+pS1.example_key"
}
Failure response
{
"code": -1,
"message": "s3: show_key: customer not found"
}
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×