Insert Record into Custom Table
POST/api/thirdparty/customtable/{table_name}
Inserts a new record into the specified custom table. All columns in the request body must exist in the table, otherwise an error will be returned.
Headers
| Field | Type | Description |
|---|---|---|
| authtoken | String | Authentication token, generated from admin area |
| Content-Type | String | application/json |
Parameters
| Field | Type | Description |
|---|---|---|
| table_name | String | Name of the custom database table (exact table name as it exists in the database) |
curl -X POST "https://yoursite.com/api/thirdparty/customtable/TABLE_NAME" \
-H "authtoken: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "field": "value" }' Success-Response:
HTTP/1.1 201 Created
{
"status": true,
"message": "Record created successfully",
"id": 5
} Error-Response (Column Not Found):
HTTP/1.1 400 Bad Request
{
"status": false,
"message": "Column 'invalid_column' does not exist in table 'george'"
}