Device App User Update
The device app user update endpoint allows mobile applications and client systems to update user profile information and settings. This endpoint is commonly used for profile management, preference updates, and user data synchronization across devices.
Base URL: https://gate.zequenze.com/api/v1
Authentication: All endpoints require a Bearer token:
Authorization: Bearer <your-api-token>
Overview
The Device App User Update API provides functionality for updating user information within the GATE platform. This endpoint is designed specifically for mobile applications and client software that need to modify user profiles, preferences, and account settings.
Common scenarios include updating user profiles when users change their personal information, synchronizing user preferences across multiple devices, and maintaining up-to-date user data for personalized experiences. The endpoint accepts user data in a flexible format, allowing applications to update various user attributes in a single request.
This API is particularly useful for mobile applications that need to handle offline profile edits and sync them when connectivity is restored, or for admin interfaces that manage user accounts across an organization.
Endpoints
POST /device_app_user_update/
Description: Updates user information including profile details, preferences, and account settings. This endpoint accepts user data and applies the updates to the specified user account, returning confirmation of the changes made.
Use Cases:
- Mobile app profile editing where users update their name, email, or preferences
- Bulk user data updates from administrative interfaces
- Synchronization of user settings across multiple devices
- Integration with external systems that manage user information
Full URL Example:
https://gate.zequenze.com/api/v1/device_app_user_update/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| data | string | body | Yes | JSON string containing user information to update. Should include user ID and the fields to be modified |
Request Body Structure:
The data parameter should contain a JSON string with the following structure:
{
"user_id": "12345",
"profile": {
"first_name": "John",
"last_name": "Smith",
"email": "john.smith@example.com",
"phone": "+1-555-0123"
},
"preferences": {
"notifications_enabled": true,
"language": "en",
"timezone": "America/New_York"
},
"device_info": {
"device_id": "device_123",
"app_version": "2.1.0",
"platform": "iOS"
}
}
cURL Example:
curl -X POST "https://gate.zequenze.com/api/v1/device_app_user_update/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"data": "{\"user_id\": \"12345\", \"profile\": {\"first_name\": \"John\", \"last_name\": \"Smith\", \"email\": \"john.smith@example.com\"}, \"preferences\": {\"notifications_enabled\": true, \"language\": \"en\"}}"
}'
Example Response:
{
"success": true,
"message": "User information updated successfully",
"user_id": "12345",
"updated_fields": [
"profile.first_name",
"profile.last_name",
"profile.email",
"preferences.notifications_enabled",
"preferences.language"
],
"updated_at": "2024-01-15T14:30:22Z",
"version": 15
}
Response Codes:
| Status | Description |
|---|---|
| 201 | Created - User information updated successfully |
| 400 | Bad Request - Invalid data format or missing required fields |
| 401 | Unauthorized - Invalid or missing authentication token |
| 404 | Not Found - User ID not found in system |
| 422 | Unprocessable Entity - Validation errors in provided data |
| 500 | Internal Server Error - Server error processing the update |
Common Use Cases
Use Case 1: Mobile Profile Updates
When users edit their profile information in a mobile app, use this endpoint to sync the changes to the server. Include the user ID and only the fields that have been modified to minimize data transfer.
Use Case 2: Settings Synchronization
For applications that work across multiple devices, use this endpoint to synchronize user preferences and settings. Include device information to track which device initiated the update.
Use Case 3: Administrative User Management
Admin interfaces can use this endpoint to update user information in bulk or make corrections to user profiles. Include comprehensive user data to ensure all necessary fields are updated.
Use Case 4: External System Integration
When integrating with external HR systems or identity providers, use this endpoint to keep user information synchronized across platforms.
Best Practices
- Validate Data Client-Side: Always validate user input before sending to the API to reduce 422 errors and improve user experience
- Send Only Modified Fields: To optimize performance, only include fields that have actually changed in the update request
- Handle Offline Scenarios: Store failed updates locally and retry when connectivity is restored, using the version field to prevent conflicts
- Implement Proper Error Handling: Display meaningful error messages to users based on the response codes and error details
- Rate Limiting: Implement client-side rate limiting to avoid overwhelming the API with rapid successive updates
- Data Privacy: Ensure sensitive user information is properly encrypted during transmission and follow applicable privacy regulations
- Version Control: Use the returned version number to implement optimistic locking and prevent concurrent update conflicts