transform any database into a rest api in just 5 minutes and without programming or knowing php
instucciones:
1. create a database on your web server
2. create your tables it is important that each table created has the id field
3. upload the files inside the zip file to your server in the folder you want this would be your base url.
4. Edit the api.php file inside the core folder with your database connection details and you are ready to use your database as an api.
Example:
Download:
Parameters:
[
{
"id": 1,
"column1": "value1",
"column2": "value2",
...
},
{
"id": 2,
"column1": "value3",
"column2": "value4",
...
},
...
]
Parameters:
{
"id": 1,
"column1": "value1",
"column2": "value2",
...
}
Parameters:
[
{
"id": 1,
"column1": "value1",
"column2": "value2",
...
},
{
"id": 2,
"column1": "value3",
"column2": "value4",
...
},
...
]
Parameters:
{
"column1": "value1",
"column2": "value2",
...
}
Successful response:
{
"id": 1,
"column1": "value1",
"column2": "value2",
...
}
Parameters:
{
"column1": "new_value1",
"column2": "new_value2",
...
}
Successful response:
{
"response": "Record(s) updated successfully"
}
Parameters:
{
"column1": "new_value1",
"column2": "new_value2",
...
}
Successful response:
{
"response": "Record(s) updated successfully"
}
Parameters:
{
"response": "Record(s) deleted successfully"
}
Parameters:
{
"response": "Record(s) deleted successfully"
}
instucciones:
1. create a database on your web server
2. create your tables it is important that each table created has the id field
3. upload the files inside the zip file to your server in the folder you want this would be your base url.
4. Edit the api.php file inside the core folder with your database connection details and you are ready to use your database as an api.
Example:
Download:
Magic api
b4xstore.xyz
API Documentation
Base URL
Get all records from a table
GET /api.php?table={table}Parameters:
- {table}: Name of the table to retrieve records from.
[
{
"id": 1,
"column1": "value1",
"column2": "value2",
...
},
{
"id": 2,
"column1": "value3",
"column2": "value4",
...
},
...
]
Get a record by ID
GET /api.php?table={table}&id={id}Parameters:
- {table}: Name of the table to retrieve the record from.
- {id}: ID of the record to retrieve.
{
"id": 1,
"column1": "value1",
"column2": "value2",
...
}
Search records by column and value
GET /api.php?table={table}&column={column}&value={value}Parameters:
- {table}: Name of the table to search records in.
- {column}: Name of the column to search.
- {value}: Value to search for in the specified column.
[
{
"id": 1,
"column1": "value1",
"column2": "value2",
...
},
{
"id": 2,
"column1": "value3",
"column2": "value4",
...
},
...
]
Create a new record
POST /api.php?table={table}Parameters:
- {table}: Name of the table to create a new record in.
{
"column1": "value1",
"column2": "value2",
...
}
Successful response:
{
"id": 1,
"column1": "value1",
"column2": "value2",
...
}
Update a record by ID
PUT /api.php?table={table}&id={id}Parameters:
- {table}: Name of the table to update the record in.
- {id}: ID of the record to update.
{
"column1": "new_value1",
"column2": "new_value2",
...
}
Successful response:
{
"response": "Record(s) updated successfully"
}
Update a record by column and value
PUT /api.php?table={table}&column={column}&value={value}Parameters:
- {table}: Name of the table to update the record in.
- {column}: Name of the column to search.
- {value}: Value to search for in the specified column.
{
"column1": "new_value1",
"column2": "new_value2",
...
}
Successful response:
{
"response": "Record(s) updated successfully"
}
Delete a record by ID
DELETE /api.php?table={table}&id={id}Parameters:
- {table}: Name of the table to delete the record from.
- {id}: ID of the record to delete.
{
"response": "Record(s) deleted successfully"
}
Delete a record by column and value
DELETE /api.php?table={table}&column={column}&value={value}Parameters:
- {table}: Name of the table to delete the record from.
- {column}: Name of the column to search.
- {value}: Value to search for in the specified column.
{
"response": "Record(s) deleted successfully"
}
Attachments
Last edited: