Method | Endpoint |
---|---|
POST | /userHandler |
POST | /signin |
POST | /signout |
POST | /userHistory |
POST | /reset-password |
PUT | /user/:uid/name |
GET | /user/:uid |
POST | /user/:uid/profile-picture |
This method is used for user registration on the application.
{
"emailField": "[email protected]",
"fullnameField": "nametest",
"passwordField": "passwordtest123"
}
{
"status": "success",
"message": "Sign-up has been successful",
"data": {
"uid": "kejgT4WlafYbjhcI5kn2xUPb8gh1"
}
}
{
"status": "fail",
"message": "All fields need to be filled. (Email, Full name, and Password)"
}
{
"status": "fail",
"message": "An error occurred during sign-up"
}
This method is used for user sign-in on the application.
{
"email": "[email protected]",
"password": "passwordtest123"
}
{
"status": "success",
"message": "Sign-in successful",
"data": {
"uid": "kejgT4WlafYbjhcI5kn2xUPb8gh1",
"email": "[email protected]"
}
}
{
"status": "fail",
"message": "Email and password are required."
}
{
"status": "fail",
"message": "An error occurred during sign-in",
}
This method is used for user sign-out on the application. This method doesn't require request body.
{
"status": "success",
"message": "Sign-out successful"
}
{
"status": "fail",
"message": "An error occurred during sign-out"
}
This method is used for storing prediction results for each user in the database.
{
"userId": "123456",
"history": {
"prediction1": "result1",
"prediction2": "result2"
}
}
{
"message": "User history saved successfully"
}
This method is used for sending email to the user to do reset password process.
{
"email": "[email protected]"
}
{
"status": "success",
"message": "Password reset email sent successfully."
}
{
"status": "fail",
"message": "Email is required."
}
{
"status": "fail",
"message": "An error occurred while sending the password reset email."
}
This method is used for changing the name of the uid
that was read out. The request parameter needed is the userid
.
{
"uid": "kejgT4WlafYbjhcI5kn2xUPb8gh1",
"name" : "namechangetest"
}
{
"status": "success",
"message": "Name updated successfully."
}
{
"status": "fail",
"message": "UID and name are required."
}
{
"status": "fail",
"message": "User not found."
}
{
"status": "fail",
"message": "An error occurred while updating name."
}
This method is used to get user information based on the uid
that was read out. This method doesn't require a request body, rather just needs the uid
from the user.
{
"status": "Success",
"user": {
"uid": "user_id_yang_terinput",
"email": "[email protected]"
}
}
{
"status": "Failed",
"message": "Data not found"
}
{
"status": "Failed",
"message": "Error retrieving user data"
}
This method is used to input the user profile picture. The request parameter needed is the uid
of a specific user. The request body is in a file format as shown in the screenshot below.
{
"status": "success",
"message": "Profile picture added successfully."
}
{
"status": "fail",
"message": "UID and profile picture are required."
}
{
"status": "fail",
"message": "User not found."
}
{
"status": "fail",
"message": "An error occurred while adding profile picture."
}
In order to use the ML API Service, the user needs to send form data to the server using the POST method. Here are the things that need to be included in the form data.
This is an image file that is needed for inference purpose using the machine learning model that was developed before by the Machine Learning Engineers. Based on the test that has been conducted, the appropriate image format is .JPG.
This key is used for specifying which machine learning model that will be loaded to perform the inferencing process. The value format for this key is PD-model_name
or FP-model_name
, where "PD" is indicating the plant crop disease models and "FP" indicating the fruit and vegetable ripeness models.
Example: PD-Grape
will refer to loading the plant crop disease model that has been trained for identifying the grape plant crop disease classes.
This key is used for defining the storage location of all the inference results for each specific user based on their uid
. The response field's names are the same as the field names that have been defined inside the Firebase Auth and Firestore.
{
"class" : "Sifat_Terdeteksi",
"confidence" : "0.7675789",
"description" : "Deskripsi_untuk_sifat_terdeteksi",
"time" : "Mon Jun 12 15:24:12 2023"
}