API files of Trust Fall Android app. This API is build up on PHP for backend and MySQL for database. API uses an external php library for MySQLi database wrap, checkout the library https://github.com/ThingEngineer/PHP-MySQLi-Database-Class
Create a new user from the trustfall app and add it to the database
Method | Uri | Authorization |
---|---|---|
POST | /create_user.php |
auth_pass |
{
"auth_key": "[AUTH-KEY]",
"username": "Candace",
"mobile": "9287548490",
"password": "mypassword",
"emergency_contact": "9747187296"
}
Parameter | type | Details | Example |
---|---|---|---|
auth_key |
String | Auth key given in the env.php |
ef98y3497th34 |
username |
String | Full name of the new user | Canadace |
mobile |
String | 10 digit mobile number of the user | 9747187296 |
password |
String | Min 8 chars user password | mypassword |
emergency_contact |
String | 10 digit emergency contact number, to which the distress signal will be sent | 9747187296 |
{
"status": true,
"code": "user-created",
"user_id": 3,
"user_mobile": "9287548490",
"description": "User is successfully created"
}
Code | Description |
---|---|
user-created |
User is successfully created |
user-exist |
User with this mobile no. is already registered |
error |
Error when inserting the user to the database table |
Get all details and reports of the already existing user from the database
Method | Uri | Authorization |
---|---|---|
GET | /user_details.php |
password |
{
"auth_key": "[AUTH-KEY]",
"mobile": "9287548490",
"password": "mypassword",
}
Parameter | type | Details | Example |
---|---|---|---|
auth_key |
String | Auth key given in the env.php |
ef98y3497th34 |
mobile |
String | 10 digit mobile number of the user | 9747187296 |
password |
String | Raw password of the user | mypassword |
{
"status": true,
"code": "user-found",
"user_details": {
"id": 1,
"mobile": "9747187296",
"username": "Candace",
"password": "mypassword",
"emergency_contact": "9747187263",
"current_status": 0
}
}
Code | Description |
---|---|
user-found |
User data is sucessfully fetched |
user-pass-incorrect |
User is found, but the password doesn't match |
user-non-exist |
User with this mobile no doesn't exist in the database |
This API route handles the distress call sending functions, Distress call is sent as direct automated TTS phone call and SMS to the emergency contact numbers
Method | Uri | Authorization |
---|---|---|
GET | /send_beacon.php |
password |
{
"auth_key": "[AUTH-KEY]",
"mobile": "9287548490",
"password": "mypassword",
}
Parameter | type | Details | Example |
---|---|---|---|
auth_key |
String | Auth key given in the env.php |
ef98y3497th34 |
mobile |
String | 10 digit mobile number of the user | 9747187296 |
password |
String | Raw password of the user | mypassword |
{
"status": true,
"code": "becon-sent"
}
Trust Fall API is licensed under the MIT License.