This API allows users to retrieve and add data to ClipBin. It includes two primary functions: get_data (GET request) and post_data (POST request).
Retrieve data from the database based on specific parameters.
Parameter | Type | Required | Description |
---|---|---|---|
id | string | Yes | The unique identifier for the data. |
name | string | No | The name associated with the data. |
pwd | string | No | The password for authorization. |
unlisted | string | No | Filter for unlisted data. Accepted values: true or false. |
[
{
"id": "URL Id",
"name": "Sample Name",
"text": "Sample Text",
"time": "Saving Time"
}
]
{
"Error": "Missing Parameters!"
}
{
"Message": "To Search, enter Id not Name with unlisted!"
}
{
"Error": "Incorrect Password"
}
{
"Error": "No Data"
}
GET /get_data?id=1&name=Sample&pwd=example_password&unlisted=false
[
{
"id": "URL Id",
"name": "Sample Name",
"text": "Sample Text",
"time": "Saving Time"
}
]
Add new data to the database.
Parameter | Type | Required | Description |
---|---|---|---|
name | string | Yes | The name associated with the data. |
text | string | Yes | The text content to be stored. |
pwd | string | No | The password for protecting the data. |
unlisted | string | No | Specify if the data should be unlisted. Accepted values: true or false. |
{
"name": "Sample Name",
"text": "Sample Text",
"pwd": "example_password",
"unlisted": "false"
}
{
"id": "url_id", "Message": "Successfully added!"
}
{
"Error": "Missing Parameters!"
}
{
"Error": "Couldn't add. Something went wrong."
}
POST /post_data
Body:
{
"name": "Sample Name",
"text": "Sample Text",
"pwd": "example_password",
"unlisted": "false"
}
{
"id": "clip_id", "Message": "Successfully added!"
}
Status Code | Description |
---|---|
200 | OK – Request succeeded. |
201 | Created – Resource successfully created. |
400 | Bad Request – Request was invalid. |
401 | Unauthorized – Authentication failed. |
404 | Not Found – Resource not found. |
(pwd) is required for retrieving protected data and optional for adding data.