CRUD services
You can access CRUD services on the following URLs:
https://<DOMAIN>/makermike/crud_<ACTION>?table=<TABLE_NAME>
or
https://<DOMAIN>/makermike/crud_<ACTION>?project=<PROJECT_NAME>&table=<TABLE_NAME>
Where:
<DOMAIN>is your project domain or your project domain name as a subdomain of console.makermike.io16.com<PROJECT_NAME>, you can specify the project name in the query string if it is not specified, it will be read from the domain.<ACTION>, the desired CRUD action
All CRUD actions support two types of methods to perform the actions:
-
Form datamethod: to retrieve data, example:curl -sS -b <FILE_TO_STORE_AUTHORIZATION_TOKEN>.txt -X POST "https://example.com/makermike/crud_create?table=employee" \ -F name="John" \ -F last_name="Doe" -
JSONmethod: to create data, example:curl -sS -b <FILE_TO_STORE_AUTHORIZATION_TOKEN>.txt -X POST "https://example.com/makermike/crud_create?table=employee" \ -H 'Content-Type: application/json' \ -d '{"name": "John", "last_name": "Doe"}'
Create service
Create service allows users to create a row in the desired table.
Read service
Read service allows users to read data from the desired table.
Additional read features
The read service currently holds features that can be used adding keys to the query string in the URL.
Show
This key only accepts the values true or True, returns all values of the column set in the table property show (by default the first column of the table), you can check more about this property at Table properties.
Usage:
https://<DOMAIN>/makermike/crud_read?table=<TABLE_NAME>&show=True
Example:
https://my_project/makermike/crud_read?table=_user&show=True
Example result:
{
"show": name,
"data": [
{
"id": 1,
"name": "System Administrator"
},
{
"id": 2,
"name": "User"
}
],
"original_data": [
{
"id": 1,
"name": "System Administrator"
},
{
"id": 2,
"name": "User"
}
],
"columns": [
{
"0": "id",
"1": null,
"2": null,
"3": null,
"4": null,
"5": null,
"6": null,
"7": null
},
{
"0": "name",
"1": "text(255)",
"2": "name",
"3": null,
"4": null,
"5": null,
"6": null,
"7": null
}
]
}
Only
This key accepts multiple column names each separated by comma without spaces, and returns the values from the specified columns.
Usage:
https://<DOMAIN>/makermike/crud_read?table=<TABLE_NAME>&only=<COLUMN_NAME>
Example:
https://my_project/makermike/crud_read?table=_text_resource&only=text
Example result:
{
"show": name,
"data": [
{
"id": 1,
"text": "Text resource 1"
},
{
"id": 2,
"text": "Text resource"
}
],
"original_data": [
{
"id": 1,
"text": "Text resource 1"
},
{
"id": 2,
"text": "Text resource"
}
],
"columns": [
{
"0": "id",
"1": null,
"2": null,
"3": null,
"4": null,
"5": null,
"6": null,
"7": null
},
{
"0": "text",
"1": "text(255)",
"2": "text",
"3": null,
"4": null,
"5": null,
"6": null,
"7": null
}
]
}
ID
This key accepts a single ID, and returns the row with the specified ID.
Usage:
https://<DOMAIN>/makermike/crud_read?table=<TABLE_NAME>&id=<ID>
Example:
https://my_project/makermike/crud_read?table=_user&id=1
Example result:
{
"show": name,
"data": [
{
"id": 1,
"name": "System Administrator"
}
],
"original_data": [
{
"id": 1,
"name": "System Administrator"
}
],
"columns": [
{
"0": "id",
"1": null,
"2": null,
"3": null,
"4": null,
"5": null,
"6": null,
"7": null
},
{
"0": "name",
"1": "text(255)",
"2": "name",
"3": null,
"4": null,
"5": null,
"6": null,
"7": null
}
]
}
Update service
Update service allows users to update a row in the desired table.
Delete service
Delete service allows users to delete a row from the desired table.