1) allTables : List all PostgreSQL Tables
Method Get
Url /api/allTables
Parameters None
2) tableContents : Show PostgreSQL table contents
Method Post
Url /api/tableContents
Parameters tablename
3) createTable : Create a new PostgreSQL table with the following columns: id, latitude, longitude, category, description, date_added
Method Post
Url /api/createTable
Parameters tablename
4) dropTable : Remove a PostgreSQL table
Method Post
Url /api/dropTable
Parameters tablename
5) createUser : Create a PostgreSQL Database User
Method Post
Url /api/createUser
Parameters username, password
6) grantUser : Grant the SELECT privilege on a postgres table to a user
Method Post
Url /api/grantUser
Parameters username, tablename
7) revokeUser : Revoke the SELECT privilege from a user on a postgres table
Method Post
Url /api/revokeUser
Parameters username, tablename
8) dropUser : Remove the specified user, A user cannot be removed if it is still referenced in any database of the cluster.
Method Post
Url /api/dropUser
Parameters username
9) insert : Create new rows in a table.
Method Post
Url /api/insert
Parameters tablename, latitude, longitude, descrption, category, sub_category, planche, status, report_id, date_added
10) renameTable : Rename a PostgreSQL table
Method Post
Url /api/renameTable
Parameters newname, oldname
11) updateStatus : Update report status
Method Post
Url /api/updateStatus
Parameters id, tablename, status
12) updateCategory : Update report's category name
Method Post
Url /api/updateCatgory
Parameters id, tablename, category
13) updateSubCategory : Update report's sub category name
Method Post
Url /api/updateSubCatgory
Parameters id, tablename, sub_category
PHP CURL
$curl = curl_init();
$token='my token';
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://sig.ypodo.com/api/allTables',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json",
"Accept: application/json",
"Authorization: Bearer $token"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;