-
Notifications
You must be signed in to change notification settings - Fork 3
GlobeScanner API documentation
Welcome to the GlobeScanner wiki!
Users can register as a tourist or guide to the application with their username, email, password and role(Tourist/Guide).
Output
Error responses for sign up:
Condition: password length is not in between 6 to 20 characters.
{
"error": "incorrect parameters, password should be between 6 to 20 chars"
}
Condition: The email input by the user is already registered.
{
"error": "this Email is already taken by other user"
}
Condition: Error occurred while hashing the password or other internal errors.
{
"error": "interval server error"
}
Users have to login with their email,password and role(Tourist/Guide) to the application.
Output
Error responses for login:
Condition: Error in input parameters (not binding the required conditions).
{
"error": "incorrect input parameters"
}
Condition: No user found with given login credentials
{
"error": "user not found or role does not match"
}
Condition: Error occurred while hashing the password or other internal errors.
{
"error": "wrong password"
}
Tourists and guides will both have access to see their account profile.
Output For Guide profile
Output for Tourist profile
Error responses for checking user profile:
Condition: Error in authorization token (not binding the required conditions).
{
"error": "Unauthorized"
}
Condition: Unknown error
{
"error": "Internal server error."
}
Tourists have access to edit details on their account profile.
Output
Error responses for editing tourist profile:
Condition: Error in authorization token (not binding the required conditions).
{
"error": "Unauthorized"
}
Condition: If input request does not satisfy data constraints
{
"error": "invalid input"
}
Condition: Unknown error
{
"error": "Internal server error."
}
Output
Error responses for editing guide profile:
Condition: Error in authorization token (not binding the required conditions).
{
"error": "Unauthorized"
}
Condition: If input request does not satisfy data constraints
{
"error": "invalid input"
}
Condition: Unknown error
{
"error": "Internal server error."
}
Tourists and Tour guides can look up for the places to see in an area.
Output
Error responses for search places:
Condition: Error in authorization token (not binding the required conditions).
{
"error": "Unauthorized"
}
Condition: When location name is invalid
{
"error": "Please enter a valid location name."
}
Guides can add tour packages for any location.
Output
Error responses for add packages:
Condition: Error in authorization token (not binding the required conditions).
{
"error": "Unauthorized"
}
Condition: When request is not made by a guide
{
"error": "User needs to be a Guide. Please register as a Guide."
}
Condition: If input request does not satisfy data constraints
{
"error": "incorrect parameters"
}
Condition: Unknown error
{
"error": "Internal server error."
}
Guides can see all the tour packages they have added on their profile.
Output
Error responses for viewing added packages:
Condition: Error in authorization token (not binding the required conditions).
{
"error": "Unauthorized"
}
Condition: When request is not made by a guide.
{
"error": "User needs to be a Guide. Please register as a Guide."
}
Condition: When no packages are available for the searched location.
{
"error": "No package currently available for this user."
}
Condition: Unknown error.
{
"error": "Internal server error."
}
Tourists/Guides can view tour packages available for the place they have searched.
Output
Error responses for search packages:
Condition: Error in authorization token (not binding the required conditions).
{
"error": "Unauthorized"
}
Condition: When location name is not valid.
{
"error": "Please enter a valid location name."
}
Condition: When no packages are available for the searched location.
{
"error": "No package currently available for this location."
}
Condition: Unknown error
{
"error": "Internal server error."
}
Tourists can book any available tour package for a location. Based on the package selected by the tourist, the corresponding packageId will be sent in request to server.
Error responses for book packages:
Condition: Error in authorization token (not binding the required conditions).
{
"error": "Unauthorized"
}
Condition: When user is not a tourist.
{
"error": "User needs to be a Tourist. Please register as a tourist."
}
Condition: Unknown error
{
"error": "Internal server error."
}
Tourists can see their booked packages on their profile. Based on the email extracted from authorization token, a list of the corresponding booked packages are returned in response.
Error responses for view bookings:
Condition: The user authentication fails
{
"unauthorized"
}
Condition: When user is not a tourist
{
"error": "User needs to be a Tourist."
}
Condition: Unknown error
{
"error": "Error occured. Please try again."
}
Tourists can add reviews of any tour packages that they have booked.
Output
Error responses for adding comments:
Condition: The user authentication fails
{
"unauthorized"
}
Condition: When user is not a tourist
{
"error": "User needs to be a Tourist."
}
Condition: Unknown error
{
"error": "Error occured. Please try again."
}
Cooments for any package can be viewed by sending the packageId in request to server.
Output
Error responses for viewing comments:
Condition: The user authentication fails
{
"unauthorized"
}
Condition: Unknown error
{
"error": "Error occured. Please try again."
}
Tourists can fetch all the comments given by him
Error responses for adding comments:
Condition: The user authentication fails
{
"unauthorized"
}
Condition: When user is not a tourist
{
"error": "User needs to be a tourist."
}
Condition: Unknown error
{
"error": "Error occured. Please try again."
}
Users can logout by giving the Acess token in the Authorization
Error responses for logout:
Condition: The user authentication fails
{
"unauthorized"
}
Users can refresh and get a new Access token and Refresh token when the Access token is expired
Error responses for refresh:
Condition: The user authentication fails
{
"unauthorized"
}
Condition: When the Refresh token is expired
{
"error": "Refresh token expired"
}
Condition: Unknown error
{
"error": "Error occured"
}