Guest - YoussefMRefaat/timezone GitHub Wiki
Only guests (unauthenticated) can access these points
Signup
-
URL
/api/signup
-
Method
POST
-
URL Params
None
-
Data Params
Required:
first_name=[string,max:15]
last_name=[string,max:15]
email=[email,unique]
password=[string,min:6]
must contain at least one number and one letterpassword_confirmation=[password]
gender=["male" or "female"]
primary_phone=[string,max:20]
primary_address=[string,max:100]
Optional:
sec_phone=[string,max:20]
sec_address=[string,max:100]
-
Success response
Code: 201
Content: { "Message" => "Registered successfully", "token" => :token, "type" => "Bearer", "Role" => :role }
-
Error response
Code: 403
Content: { "Message" => "Already authenticated" }
ORCode: 422
Content: { "Message" => "The given data was invalid", "errors": { :field : [:messages ], :field : [:messages ] ...} }
Login
-
URL
/api/login
-
Method
POST
-
URL Params
None
-
Data Params
Required:
email=[email]
password=[string]
-
Success response
Code: 201
Content: { "Message" => "Logged in successfully", "token" => :token, "type" => "Bearer", "Role" => :role }
-
Error response
Code: 403
Content: { "Message" => "Already authenticated" }
ORCode: 401
Content: { "Message" => "Invalid email or password" }
ORCode: 422
Content: { "Message" => "The given data was invalid", "errors": { :field : [:messages ], :field : [:messages ] } }
Forgot Password
-
URL
/api/forgot-password
-
Method
POST
-
URL Params
None
-
Data Params
Required:
email=[email]
-
Success response
Code: 201
Content: { "Message" => "Token has been created and sent to the user's email. It will expire after: :x seconds", }
-
Error response
Code: 403
Content: { "Message" => "Already authenticated" }
ORCode: 502
Content: { "Message" => "Failed to send the code" }
ORCode: 422
Content: { "Message" => "The given data was invalid", "errors": { "email" : [:messages ] } }
Reset Password
-
URL
/api/reset-password
-
Method
PATCH
-
URL Params
None
-
Data Params
Required:
email=[email]
code=[string]
password=[string,min:6]
must contain at least one number and one letterpassword_confirmation=[password]
-
Success response
Code: 200
Content: { "Message" => "Password has bees reset successfully", }
-
Error response
Code: 403
Content: { "Message" => "Already authenticated" }
ORCode: 401
Content: { "Message" => "Invalid or expired token" }
ORCode: 422
Content: { "Message" => "The given data was invalid", "errors": { :field : [:messages ], :field : [:messages ] ...} }