This repository has been archived by the owner on Dec 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Rafael Carneiro de Moraes edited this page Dec 16, 2019
·
3 revisions
The v3 version was desinged when the integration with multiple systems was needed. In v3 we can read, create, update (both update and upsert) and delete data from the application.
With this in mind, the GET
and POST
methods had to be modified. Now, GET
only gets data and POST
creates data. There's no difference in attributes on getting data between v2 and v3, but the attributes should be inline with the endpoint.
Ex:
- Calling
api/v3/index.php?read=your-table
will work -
POST
ing this toapi/v3/index.php
will fail
{
"read": "your-table"
}
v3 use only one endpoint, but each HTTP method corresponds to a CRUD operation.
HTTP method | CRUD operation | Data |
---|---|---|
POST |
Create | JSON |
GET |
Read | Inline with endpoint |
PATCH |
Update | JSON |
PUT |
Upsert | JSON |
DELETE |
Delete | JSON |
By calling the endpoint with no data, in any method, you can consult your application model, with all the tables/fields.
Rafael Carneiro de Moraes @ 2019