Tenant User Mobile Flow
Overview
This guide summarizes the supported tenant-user mobile API flow, from login to listing tasks or surveys, submitting a response, reviewing owned responses, and completing a field task. Retired researcher-only authentication and task routes are not used.
Step 1 — Sign In
- Open the Survanta app and enter your registered email and password.
- Call
POST /api/mobile/auth/login; success returns a JWT andexpiresAtUtc. - Send
Authorization: Bearer <jwt>to protected endpoints.
Step 2 — Review Your Dashboard
The client can compose its dashboard from these APIs:
GET /api/mobile/tasksfor the current user's field tasks.GET /api/mobile/surveysfor active authenticated-visible tenant surveys and per-user response statistics.GET /api/Notifications/unread-countfor the unread notification count.
Tap any item to navigate directly to its detail screen.
Step 3 — View a Task
- Tap Tasks in the bottom navigation bar (or tap a task from the Home screen).
- The API returns task
id,title, coordinates,taskDate,isDone,completedAt, optionalsurveyId, andcanStartSurvey. - Filter by
fromDate,toDate, orisDone; optionalpage/pageSizeslices the ordered result with a maximum page size of 100. - There is no mobile task-acceptance or In-Progress transition endpoint.
Step 4 — Open the Associated Survey
- Use the task's
surveyIdonly whencanStartSurveyis true, or choose a survey fromGET /api/mobile/surveys. - Load the runtime from
GET /api/mobile/surveys/{surveyId}. - The centralized access policy remains authoritative; a task never grants survey access by itself.
Step 5 — Fill in and Submit the Survey
- Work through each question in the questionnaire. Questions may include:
- Multiple-choice selections
- Text entry fields
- Rating scales
- Yes/No toggles
- Use Next and Back to move between sections if the survey has multiple pages.
- Client-side draft/offline saving is not supplied by these server endpoints.
- Submit to
POST /api/mobile/surveys/{surveyId}/submissionswith a stableclientSubmissionIdand required location/consent data. - Treat the API response as the authoritative submission result.
Owned responses are available from GET /api/mobile/submissions; details provide server-calculated canEdit and nonEditableReason.
Step 6 — Mark the Task as Complete
- Return to the task detail screen.
- Call
POST /api/mobile/tasks/{id}/completewith optional completion GPS data. - Success sets
isDone; the list can then be filtered withisDone=trueorfalse.
Step 7 — Check Notifications
Throughout the flow, you may receive push or in-app notifications for:
- New task assignments
- Reminders for upcoming deadlines
- Confirmation of successful survey submissions
- Messages from your organization's administrator
Tap a notification to navigate directly to the related screen.
Step 8 — Sign Out
When finished, the client should optionally remove its registered device token, then delete the JWT from secure local storage. No server-side mobile logout/revocation endpoint exists.
Summary of the Full Flow
| Step | Action | Result |
|---|---|---|
| 1 | Sign in | JWT and expiry returned |
| 2 | Load APIs | Tasks, surveys, and unread count available |
| 3 | Review task | Assigned task contract loaded; no acceptance transition |
| 4 | Open survey | Authorized runtime displayed |
| 5 | Submit survey | Idempotent response result returned |
| 6 | Complete task | isDone becomes true on success |
| 7 | Sign out | Local JWT removed; issued token is not server-revoked |