-
Notifications
You must be signed in to change notification settings - Fork 8
updateuser
/updateuser/ endpoint in SWAGGER-UI
curl -X 'PUT' \ 'http://peviitorqa.go.ro/api/v0/updateuser/?id=<string>&url=<string>&company=<string>&logo=<string>&apikey=<string>' \ -H 'accept: application/json'
-
Method:
PATCH -
Endpoint name:
/updateuser -
Request Parameters:
-
apikey(required) – The API key assigned to the user. -
id– The unique identifier for the user (email address encoded as a URL parameter). -
url– The company's careers page URL. -
company– The company associated with the user. -
logo– The logo URL of the company.
-
-
Response Format:
application/json; charset=utf-8
{
"id": "<string>",
"url": "<string>",
"company": "<string>",
"logo": "<string>",
"apikey": "<string>"
}-
200 OK– Request successful, the user document was updated. -
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– No user found with the specifiedapikey. -
405 Method Not Allowed– OnlyPATCHrequests 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). - Identifies user using the
apikeyand returns a404 Not Foundif no match. - Updates only the fields provided in the request payload while preserving other fields.
- On successful update, the modified document is returned in the response.
-
CORS policy: Open to all (
Access-Control-Allow-Origin: *). - Authentication & Authorization: Not implemented in the current version.
- Rate Limits: Not specified but should be considered for production environments.
- SOLR Search Server – Required to fetch and update user data.
-
PHP
file_get_contentsfunction – Used to communicate with the SOLR server.
-
SOLR Downtime: If SOLR is unavailable, API returns a
503error. -
Empty Dataset: If no user exists with the given API key, a
404 Not Foundis returned. - Non-empty Fields: All provided fields must contain valid, non-empty strings.
- Unique Values: API keys must be unique for each user.
-
Invalid ID Format: Missing or invalid
apikeyvalues return a400 Bad Requesterror. - Security Risks: API keys and updated data are echoed in the response. Secure handling is advised.
- 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 updates user information in a SOLR index. This endpoint will be used to modify specific user details based on a unique identifier.
-
Functionality:
- The endpoint should accept an apikey and updated field values as input (it should receive in body apikey and at least one more field).
- It should update the corresponding user's information in the SOLR index.
- The endpoint should support updating fields such as URL, company, logo, and id.
-
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, the user is not found, or the update operation fails.
-
User Experience:
- The endpoint should respond quickly to ensure a seamless user experience.
- The response should include the updated user information.
-
Data Integrity:
- Ensure that the updated user data is accurate and consistent.
- The endpoint should only update 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 updates user information in the SOLR index based on the provided identifier and updated fields.
- The endpoint returns the updated 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 issues with the SOLR index could prevent updates from being applied.
- Mitigation: Regularly monitor the SOLR index for errors and perform maintenance as needed.
-
Risk: High traffic could impact performance.
- Mitigation: Implement load balancing and optimize server resources to handle increased traffic.
-
Risk: Unauthorized access could lead to data breaches.
- Mitigation: Implement robust security measures, including authentication and authorization checks.