All checks were successful
Auto Tag on Version Change / check-version (push) Successful in 4s
93 lines
1.9 KiB
Markdown
93 lines
1.9 KiB
Markdown
# Personal Profile
|
|
|
|
Fetch the user's personal profile details. This endpoint returns an HTML page; data is extracted via HTML scraping.
|
|
|
|
---
|
|
|
|
## Endpoint
|
|
|
|
```
|
|
GET https://faisamobilex-wv.mib.com.mv/personalProfile
|
|
```
|
|
|
|
---
|
|
|
|
## Authentication
|
|
|
|
Session cookies only — no additional AJAX headers required.
|
|
|
|
```
|
|
Cookie: mbmodel=IOS-1.0; xxid=<session_xxid>; IBSID=<session_xxid>; mbnonce=<nonceGenerator>; time-tracker=597
|
|
```
|
|
|
|
---
|
|
|
|
## Response
|
|
|
|
**Content-Type:** `text/html; charset=UTF-8`
|
|
|
|
The page contains an `<h5>` with the user's full name and `<span>` elements with labelled fields.
|
|
|
|
### Parsing Strategy
|
|
|
|
**Full name** — extracted from:
|
|
```html
|
|
<h5 class="mb-1 text-dark fw-semibold">Mohamed Ali</h5>
|
|
```
|
|
|
|
Regex:
|
|
```kotlin
|
|
Regex("""<h5 class="mb-1 text-dark fw-semibold">\s*([^<]+)\s*</h5>""")
|
|
```
|
|
|
|
**Labelled fields** — each follows this pattern:
|
|
```html
|
|
<span ...><b ...>Username:</b ...>...<span ...>myusername</span>
|
|
```
|
|
|
|
Regex (used for each label):
|
|
```kotlin
|
|
Regex(
|
|
"""<span[^>]*>\s*<b[^>]*>\s*$label\s*</b[^>]*>.*?<span[^>]*>([^<]+)</span>""",
|
|
setOf(RegexOption.DOT_MATCHES_ALL, RegexOption.IGNORE_CASE)
|
|
)
|
|
```
|
|
|
|
---
|
|
|
|
## Extracted Fields
|
|
|
|
| Label in HTML | Field | Description |
|
|
|---|---|---|
|
|
| `Username:` | `username` | Login username |
|
|
| `Email:` | `email` | Registered email address |
|
|
| `Mobile no:` | `mobile` | Registered mobile number |
|
|
| `Enrolled:` | `enrolled` | Enrollment date or status |
|
|
|
|
Combined with the `fullName` from the `<h5>`:
|
|
|
|
```kotlin
|
|
data class MibPersonalProfile(
|
|
val fullName: String,
|
|
val username: String,
|
|
val email: String,
|
|
val mobile: String,
|
|
val enrolled: String
|
|
)
|
|
```
|
|
|
|
---
|
|
|
|
## Notes
|
|
|
|
- Returns `null` if the response cannot be parsed (network error or unexpected HTML structure).
|
|
- This endpoint does not have a JSON equivalent — scraping is the only method.
|
|
|
|
---
|
|
|
|
|
|
|
|
---
|
|
|
|
[← Financing](06-financing.md) **Next →** [Transfer](08-transfer.md)
|