-
Notifications
You must be signed in to change notification settings - Fork 26
2.2.0) Requests: GET
Marco Cesarato edited this page Apr 9, 2019
·
2 revisions
Retrieve data from dataset
-
Fetch all:
/[token]/[database]/[table].[format]
-
Fetch all with limit:
/[token]/[database]/[limit]/[table].[format]
-
Fetch:
/[token]/[database]/[table]/[ID].[format]
-
Fetch search by column:
/[token]/[database]/[table]/[column]/[value].[format]
-
Fetch all joining table:
join[table] = array( 'on' => <column_id>, // Column of the table joined 'value' => <value>, // Column of main table or value 'method' => (left|inner|right) // Optional )
Example with value:
join[users]['on'] = id join[users]['value'] = 1 join[users]['method'] = 'INNER'
Example with column:
join[users]['on'] = id // Column of the table joined join[users]['value'] = user_id // Column of the main table (no users) join[users]['method'] = 'INNER'
-
Additional parameters
ex: /[database]/[table]/[column]/[value].[format]?order_by=[column]&direction=[direction]
Examples of GET requests:
GET /dataset/users.json HTTP/1.1
Host: localhost
GET /dataset/10/users.json HTTP/1.1
Host: localhost
GET /dataset/users/1.json HTTP/1.1
Host: localhost
GET /dataset/users/is_active/1.json?order_by=username&direction=desc HTTP/1.1
Host: localhost