Methods
Reference
/api/auth/grant
Grant user permissions to interact with specific table.
Parameters
Name | Type | Description |
user_name | string | Specifies a DropKit user |
table_name | string | Specifies a table name |
caller_pk | string | Caller private key |
Response
Content Type: application/json
Name | Type | Description |
Code | number | Response code |
Message | string | Response message |
Response Code
Code | Description |
0 | Success |
20201 | Unauthorized |
Sample Input
{
"user_name": "0x0000000000000000000000000000000000000000",
"table_name": "employee",
"caller_pk": "00000000000000000000000000000000000000000000000000000000000000000000"
}
Sample Response
{
"Code": 0,
"Message": "Ok"
}
curl Example
curl http://localhost:5000/api/auth/grant \
-X POST \
-d '{
"user_name": "0x0000000000000000000000000000000000000000",
"table_name": "employee",
"caller_pk": "00000000000000000000000000000000000000000000000000000000000000000000"
}'
{"Code": 0,"Message": "Ok"}
/api/auth/revoke
Revoke user permission to interact with a specific table.
Parameters
Name | Type | Description |
user_name | string | Specifies a DropKit user |
table_name | string | Specifies a table name |
caller_pk | string | Caller private key |
Response
Content Type: application/json
Name | Type | Description |
Code | number | Response code |
Message | string | Response message |
Response Code
Code | Description |
0 | Success |
20201 | Unauthorized |
Sample Input
{
"user_name": "0x0000000000000000000000000000000000000000",
"table_name": "employee",
"caller_pk": "00000000000000000000000000000000000000000000000000000000000000000000"
}
Sample Response
{
"Code": 0,
"Message": "Ok"
}
curl Example
curl http://localhost:5000/api/auth/revoke \
-X POST \
-d '{
"user_name": "0x0000000000000000000000000000000000000000",
"table_name": "employee",
"caller_pk": "00000000000000000000000000000000000000000000000000000000000000000000"
}'
{"Code": 0,"Message": "Ok"}
/api/auth/verify
Verify the user has permissions
Parameters
Name | Type | Description |
user_name | string | Specifies a DropKit user |
table_name | string | Specifies a table name |
caller_pk | string | Caller private key |
Response
Content Type: application/json
Name | Type | Description |
Code | number | Response code |
Message | string | Response message |
Response | bool | Verify result |
Response Code
Code | Description |
0 | Success |
20201 | Unauthorized |
Sample Input
{
"user_name": "0x0000000000000000000000000000000000000000",
"table_name": "employee",
"caller_pk": "00000000000000000000000000000000000000000000000000000000000000000000"
}
Sample Response
{
"Code": 0,
"Message": "Ok",
"Response": true
}
curl Example
curl http://localhost:5000/api/auth/verify \
-X POST \
-d '{
"user_name": "0x0000000000000000000000000000000000000000",
"table_name": "employee",
"caller_pk": "00000000000000000000000000000000000000000000000000000000000000000000"
}'
{"Code": 0,"Message": "Ok","Response": true}