REST Api
REST API Version 1
More will be added before the stable release of 1.0.0, but at the moment Devflow
has a few GET
api endpoints for consuming data. When you installed the system, an API key was automatically generated for you. You an find the key under the General settings in the backend.
Note
As of Devflow CMF 1.3.0, version 1 of the REST api is deprecated and will be removed in Devflow CMF 2.0.0. It is highly recommended that you migrate to version 2 of the REST api.
Get All Rows
curl http://example.com/v1/user/?key=01JB37JJTRE0F8983T7B6QSECZ
SELECT * FROM {prefix}user;
Order By
curl http://example.com/v1/user/?by=user_id&order=desc&key=01JB37JJTRE0F8983T7B6QSECZ
SELECT * FROM {prefix}user ORDER BY user_id DESC;
Limit
curl http://example.com/v1/user/?limit=5&key=01JB37JJTRE0F8983T7B6QSECZ
SELECT * FROM {prefix}user LIMIT 5;
Get By Column/Field
curl http://example.com/v1/user/user_login/BxToVo/?key=01JB37JJTRE0F8983T7B6QSECZ
SELECT * FROM {prefix}user WHERE user_login = 'BxToVo';
REST API Version 2
You can still user the ?key
parameter for the endpoint, but it is recommended to send over an Authorization
header instead.
The ?key
parameter option will be removed in Devflow CMF 2.0.0.
Content Endpoints
Verb | Uri | Action | Route Name |
---|---|---|---|
GET | /content | index | v2.content.index |
POST | /content/store | store | v2.content.store |
GET | /content/{id} | show | v2.content.show |
PUT/PATCH | /content/{id} | update | v2.content.update |
DELETE | /content/{id} | destroy | v2.content.destroy |
Example
curl -H "Authorization: Bearer PMhL2a4o7z9mdmW0TEjIWHjrQyLbxpbj" http://example.com/v2/content
User Endpoints
Verb | Uri | Action | Route Name |
---|---|---|---|
GET | /user | index | v2.user.index |
POST | /user/store | store | v2.user.store |
GET | /user/{id} | show | v2.user.show |
PUT/PATCH | /user/{id} | update | v2.user.update |
DELETE | /user/{id} | destroy | v2.user.destroy |
Example
curl -H "Authorization: Bearer PMhL2a4o7z9mdmW0TEjIWHjrQyLbxpbj" http://example.com/v2/user
Product Endpoints
Verb | Uri | Action | Route Name |
---|---|---|---|
GET | /product | index | v2.product.index |
POST | /product/store | store | v2.product.store |
GET | /product/{id} | show | v2.product.show |
PUT/PATCH | /product/{id} | update | v2.product.update |
DELETE | /product/{id} | destroy | v2.product.destroy |
Example
curl -H "Authorization: Bearer PMhL2a4o7z9mdmW0TEjIWHjrQyLbxpbj" http://example.com/v2/product