-
Notifications
You must be signed in to change notification settings - Fork 8
getuser
ale23yfm edited this page Mar 5, 2025
·
6 revisions
/getuser/ endpoint in SWAGGER-UI
curl -X 'GET' \ 'http://localhost:8080/api/v0/getuser/?ID=<your ID>' \ -H 'accept: application/json'
-
Method:
GET -
Endpoint name:
/getuser -
Request Parameters:
-
ID(required) – The unique identifier for the user (email address encoded as a URL parameter).
-
-
Response Format:
application/json; charset=utf-8
{
"id": "<string>",
"url": ["<string>"],
"company": ["<string>"],
"logo": ["<string>"],
"apikey": ["<string>"]
}-
id: The unique identifier for the user (email address). -
url: The company's careers page URL. -
company: The company associated with the user. -
logo: The logo URL of the company. -
apikey: The API key assigned to the user.
-
200 OK– Request successful, returns list of companies and job counts if applicable. -
400 Bad Request– Invalid request parameters or missing required fields. -
401 Unauthorized– Authentication is required or invalid credentials. -
403 Forbidden– Access denied due to insufficient permissions. -
404 Not Found– The requested endpoint or resource does not exist. -
405 Method Not Allowed– OnlyGETrequests are supported. -
500 Internal Server Error– An unexpected error occurred on the server. -
502 Bad Gateway– The primary and fallback servers are both unreachable. -
503 Service Unavailable– The SOLR server is down or unreachable. -
507 Insufficient Storage– SOLR or API server runs out of space/memory.
{
"error": "<message>",
"code": "<number>"
}- Fetches user data from the SOLR search index (
authcore). - If the requested
IDis not found, a404 Not Foundresponse is returned. - If SOLR is unavailable, a
503 Service Unavailableerror is returned.
- Queries SOLR search index (
authcore) for user data. - Uses
idas the key to retrieve user details.
- Queries user details using
q=id:<user_email>. - If no user is found, returns a
404 Not Founderror. - If SOLR is unavailable, a
503 Service Unavailableerror is returned.
-
CORS policy: Open to all (
Access-Control-Allow-Origin: *). - Authentication & Authorization: Not implemented in current version.
- Rate Limits: Not specified but should be considered for production.
- SOLR Search Server – Required to fetch user data.
-
PHP
file_get_contentsfunction – Fetches SOLR API response.
-
SOLR Downtime: If SOLR is unavailable, API returns a
503error. - Empty Dataset: If no user exists with the given ID, the API returns "There are no users to display".
-
Invalid ID Format: If
IDis not provided or is improperly formatted, a400 Bad Requesterror is returned. - Security Risks: API keys are returned in the response, which may pose security concerns.
- Non-empty string: All fields must be non-empty.
- Unique Values: Api keys are uniquely determined.
- To do: Implement authentication for accessing user data.
-
To do: Secure SOLR with
security.json. - To do: Protect SOLR by IP whitelist.
The objective of this project is to develop an API endpoint that retrieves user information from a SOLR index. This endpoint will be used to fetch specific user details based on a unique identifier.
-
Functionality:
- The endpoint should accept a user identifier as input.
- It should return the user's information stored in the SOLR index.
- The endpoint should exclude unnecessary fields (e.g., version information) from the response.
-
Error Handling:
- The endpoint should handle errors gracefully, providing meaningful error messages to users.
- Specific error handling should include scenarios where no user identifier is provided or the user is not found.
-
User Experience:
- The endpoint should respond quickly to ensure a seamless user experience.
- The response should include clear and relevant user information.
-
Data Integrity:
- Ensure that the retrieved user data is accurate and up-to-date.
- The endpoint should only return data for the specified user.
-
Security:
- Implement appropriate security measures to protect user data and prevent unauthorized access to the SOLR index.
-
Scalability:
- The endpoint should be designed to handle a high volume of requests without impacting performance.
- The endpoint successfully retrieves user information from the SOLR index based on the provided identifier.
- The endpoint returns relevant and accurate user data.
- Error messages are clear and informative for users.
- The endpoint responds within an acceptable time frame.
- The SOLR index is properly configured and populated with user data.
- Necessary infrastructure and resources are available to support the endpoint.
- Risk: Technical