You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create API endpoints that allows a user to join an organization on invite. These endpoints will validate the invitation link and automatically add the user to the specified organization upon successful validation.
Acceptance Criteria
API Endpoint Implementation:
GET Request:
The endpoint should be accessible at /invite/accept/{orgId}.
The endpoint should accept HTTP GET requests with a token query parameter.
POST Request:
The endpoint should be accessible at /api/invite.
The endpoint should accept HTTP POST requests.
Data Validation and Sanitization:
The API should validate the orgId in the parameter for GET requests and the request payload for POST requests to ensure the invitation link is present and valid.
The invitation link should be checked for correctness and validity (e.g., it hasn't expired and belongs to a valid organization).
Adding User to Organization:
Upon successful validation of the invitation link, the user should be added to the specified organization.
Response:
GET Request:
On success, the API should return a 200 OK status code with a success message.
On failure, the API should return a 400 Bad Request status code with appropriate error messages.
POST Request:
On success, the API should return a 200 OK status code with a success message.
On failure, the API should return a 400 Bad Request status code with appropriate error messages.
Request Example:
GET /invite/accept/{orgId}
POST /api/invite
{
"invitationLink": "string"
}
Successful Response:
{
"message": "Invitation accepted, you have been added to the organization",
"status": 200
}
Error Response:
{
"message": "Invalid or expired invitation link",
"errors": [
"Invalid invitation link format",
"Expired invitation link",
"Organization not found"
],
"status_code": 400
}
Purpose
Provides backend services to handle accepting invitation links for users to join an organization, ensuring the link is valid and automatically adding the user to the appropriate organization.
Requiremients
Develop server-side logic to handle invitation link submissions for both GET and POST requests.
Validate and sanitize incoming invitation link data.
Add the user to the specified organization upon successful validation of the invitation link.
Expected Outcome
The API endpoints allow users to accept invitation links via a clickable link or through a POST request, ensuring they are added to the appropriate organization.
Status Codes
200: Invitation was successfully accepted, and the user was added to the organization.
400:
Invalid invitation link format
Expired invitation link
Organization not found
500: A server error occurred
Testing
Write unit tests to ensure the invitation link endpoints validate input correctly and add users to the organization.
Perform load testing to ensure the endpoints can handle multiple requests.
Test various scenarios for submitting the invitation link (e.g., valid link, expired link, malformed link, etc.).
The text was updated successfully, but these errors were encountered:
Description
Create API endpoints that allows a user to join an organization on invite. These endpoints will validate the invitation link and automatically add the user to the specified organization upon successful validation.
Acceptance Criteria
API Endpoint Implementation:
GET Request:
/invite/accept/{orgId}
.POST Request:
/api/invite
.Data Validation and Sanitization:
Adding User to Organization:
Response:
GET Request:
POST Request:
Request Example:
GET
/invite/accept/{orgId}
POST
/api/invite
Successful Response:
Error Response:
Purpose
Provides backend services to handle accepting invitation links for users to join an organization, ensuring the link is valid and automatically adding the user to the appropriate organization.
Requiremients
Expected Outcome
Status Codes
Testing
The text was updated successfully, but these errors were encountered: