Storage API Endpoint - Free Public API
Endpoint URL:https://aisenseapi.com/services/v1/storage
Description:
This endpoint provides a versatile storage mechanism for JSON, text or file data. It allows users to either retrieve stored data using a UUID or store new data, returning a UUID as a unique identifier for future retrieval and the expire timestamp. It supports UUID v4 for identifying stored entries and ensures the integrity of stored data. All data is automatically deleted after 24 hours.
Functionality:
-
Retrieve Stored Data:
- If a valid UUID (36 characters) is provided as part of the request URI, the endpoint will attempt to retrieve the associated data from storage.
- If the UUID is unknown or not found, an error message will be returned.
-
Store New Data:
- If no UUID is provided, the endpoint generates a new UUID v4, stores the provided JSON, text or file and returns the generated UUID and the expire timestamp.
- If no data is provided or if storage fails, appropriate error messages will be returned.
Response Format:
Content-Type: application/json, application/octet-stream
Example Success Responses:
- Retrieve Data:
a) json |application/json{
"key1": "value1",
"key2": "value2"
}b) data | application/octet-stream
This is a plain text that is storedc) data | application/octet-stream
[...data from file...] - Store Data: json
{
"storage_id": "123e4567-e89b-12d3-a456-426614174000","expire_timestamp": 1738457158
}
Example Error Responses:
- UUID Not Found: json
{
"error": "Storage id unknown"
} - No Data to Store: json
{
"error": "No data to store"
} - UUID Generation Failed: json
{
"error": "UUID generation failed"
} - Failed to Create Storage Directory: json
{
"error": "Failed to create storage directory"
}
Input Requirements:
-
To Retrieve Data:
- Provide a valid STORAGE_ID (UUID) as part of the request URI:
https://aisenseapi.com/services/v1/storage/{STORAGE_ID}
- Provide a valid STORAGE_ID (UUID) as part of the request URI:
-
To Store Data:
- a) Send a POST with request content-type: application/json with a JSON payload to the endpoint:
{
"key1": "value1",
"key2": "value2"
} - b) Send a POST request content-type: text/plain with a text payload to the endpoint:
This text example to save - c) Send a POST request content-type: multipart/form-data with a file payload to the endpoint:
[...data from file...]
- a) Send a POST with request content-type: application/json with a JSON payload to the endpoint:
Use Cases:
- Temporary Storage:
- Store data temporarily and retrieve it later using the STORAGE_ID (UUID).
- Session Data:
- Save user session data or other ephemeral information.
- Data Transfer:
- Share data across systems using the STORAGE_ID (UUID) as a reference.
How to Use:
-
Store Data:
- Send a POST (json, text or file) request to the endpoint URL.
- Include a JSON, text or binary payload with the data you want to store.
- Receive a STORAGE_ID (UUID) in the response to retrieve the data later and the expire timestamp.
-
Retrieve Data:
- Send a GET request to the endpoint URL with a valid UUID as part of the URI.
- Receive the JSON data associated with the UUID.