⌘K
No token Swagger Portal
Provider app · 36 endpoints

How to use the mobile API

One route group for every healthcare provider role. Screens from the Figma doctor / nurse file map onto /api/mobile/provider. Login is phone + password — not client OTP.

Base /api/mobile/provider Client MadaCare_Mobile Accept-Language: ar | en Bearer JWT

Who it is for

Doctor, nurse, sample collector, physiotherapist, radiology technician, and health companion apps. Same shell, role-specific visit steps.

What success looks like

HTTP 200 with success: true. Business errors also return 200 with success: false and a localized message.

Figma source

Shared shell: login, home, schedule, profile. Visit wizard lives on UI + Nursing Screens. Each flow below links to the matching frame.

Figma → API

The app is a loop: sign in, land on home, open the schedule, run the visit, then manage the account.

Login

POST /auth/login

Home

GET /home

Schedule

GET /assignments

Visit

POST /visits/start

Profile

GET /profile

Conventions

Headers

Authorization: Bearer {accessToken} on every authenticated call.

Accept-Language: ar or en — only /api/mobile/* honors it. Bilingual fields collapse to one string.

Content-Type: application/json on POST/PUT.

Envelope

{
  "success": true,
  "data": {},
  "message": "optional",
  "errors": { "field": ["…"] }
}

Tokens

Do not call /connect/token from the app. Auth endpoints wrap OpenIddict password and refresh grants for MadaCare_Mobile with scope offline_access MadaCare.

Access ~8 hours, refresh ~30 days.

Login curl
curl -X POST "__ORIGIN__/api/mobile/provider/auth/login" \
  -H "Content-Type: application/json" \
  -H "Accept-Language: ar" \
  -d '{ "phoneNumber": "0512345678", "password": "P@ssw0rd", "deviceType": 2 }'

Try it on this host

Hits the API you are browsing. The token stays in this tab’s sessionStorage.

Response will appear here.

Login & recovery

Phone + password login. Tokens come from OpenIddict via the mobile auth endpoints — never call /connect/token from the app.

  1. POST /auth/login with phoneNumber + password (optional FCM device fields)
  2. Store accessToken, refreshToken, expiresIn, and user
  3. Send Authorization: Bearer {accessToken} on every authenticated call
  4. POST /auth/refresh-token before expiry
  5. Forgot: /auth/forget-password → confirm-verification-code → reset-password

Schedule & assignment

Four tabs map to ProviderMobileScheduleTab. Acknowledge before a visit can start.

  1. GET /assignments?tab=1|2|3|4
  2. GET /assignments/{appointmentId} for patient, team, canStartVisit
  3. POST /assignments/{id}/acknowledge to accept
  4. POST /assignments/{id}/reject with reasonAr if declining

Visit execution

Start from an acknowledged appointment, autosave drafts, complete steps, then complete the visit. Always send concurrencyStamp.

  1. GET /visits/by-appointment/{appointmentId} → canStart
  2. POST /visits/start/{appointmentId} with optional GPS
  3. Loop save-step-draft then complete-step per workflow step
  4. Medications, diagnosis catalog, and extra services as needed
  5. POST /visits/{visitId}/complete-visit

Profile, inbox & CMS

Account surfaces plus anonymous legal pages for the login footer.

  1. GET /profile/get-my-profile
  2. POST /profile/change-password and /profile/change-language
  3. POST /notifications/list, set-read, read-all, DELETE
  4. POST /contact-messages/send
  5. GET /site-pages/privacy-policy and /terms-and-conditions (no JWT)