Skip to main content

Device App User Update

UpdateThe device app user update endpoint allows mobile applications and client systems to update user profile information and settings. This endpoint is commonly used for deviceprofile applications.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/

UpdateDescription: Updates user information forincluding deviceprofile applications.details, preferences, and account settings. This endpoint allowsaccepts youuser data and applies the updates to modifythe specified user detailsaccount, suchreturning asconfirmation of the changes made.

Use Cases:

    Mobile app profile information,editing preferences,where users update their name, email, or device-specificpreferences settings.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 updateinformation informationto update. Should include user ID and the fields to be modified

    ExampleRequest 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/jsonjson" Authorization:\
      Bearer-d <your-api-token>
    
    '{
        "data": "{\"user_id\": \"12345\", \"name\profile\": {\"first_name\": \"JohnJohn\", Doe\\"last_name\": \"Smith\", \"email\": \"john.doe@example.smith@example.com\"}, \"device_preferences\preferences\": {\"notifications_enabled\": true, \"theme\language\": \"dark\en\"}, \"last_active\": \"2024-01-15T10:30:00Z\"}"
      }'
    

    Example Response:

    {
      "status"success": "success",true,
      "message": "User information updated successfully",
      "user_id": "12345",
      "updated_fields": [
        "name"profile.first_name",
        "profile.last_name",
        "profile.email",
        "device_preferences"preferences.notifications_enabled",
        "preferences.language"
      ],
      "timestamp"updated_at": "2024-01-15T10:15T14:30:00Z"22Z",
      "version": 15
    }
    

    Response Codes:

    Status Description
    201 Created - User information updated successfully
    400 Bad requestRequest - Invalid data format or missing required fields
    401 Unauthorized - Invalid or missing Bearerauthentication 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 Invalidthe user dataupdate

    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 FormatClient-Side: EnsureAlways the data parameter contains a valid JSON string with properly escaped quotes
    Validation: Validatevalidate user input on the client side before sending to reducethe 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: ImplementDisplay propermeaningful error handlingmessages forto allusers possiblebased on the response codes,codes especiallyand validationerror errors Security: Never include sensitive information like passwords in update requests; use dedicated password change endpointsdetails Rate Limiting: BeImplement mindful ofclient-side rate limitslimiting whento updatingavoid multipleoverwhelming usersthe inAPI successionwith rapid successive updates IdempotencyData Privacy: MultipleEnsure callssensitive withuser information is properly encrypted during transmission and follow applicable privacy regulations Version Control: Use the samereturned dataversion shouldnumber notto causeimplement issues;optimistic thelocking endpointand shouldprevent handleconcurrent duplicateupdate updates gracefullyconflicts