Get User Data
Get User Example
For view/get a specific user data you need to use the getUser and provide the id
for that user
Check the example:
import AltibbiTelehealth
let userId = 999999999
ApiService.getUser(id: userId, completion: {user, failure, error in
// Handle user as a User object
})
The
getUser
will return a user data object that could be decoded toUser
object
Responses
Status 200
Success
{
id: '999999999',
name: "Altibbi User",
email: "[email protected]",
dateOfBirth: "2000-01-30",
gender: "male",
insuranceId: "123123123",
policyNumber: '111111111',
nationalityNumber: '11110000',
height: 180,
weight: 90,
bloodType: 'A+',
smoker: 'yes',
alcoholic: 'no',
maritalStatus: 'single'
}
Status 401
UnauthorizedHttpException represents an Unauthorized HTTP exception with status code 401.
{
"name": "Unauthorized",
"message": "Your request was made with invalid credentials",
"code": "0",
"status": "401",
"type": "yii\\\\web\\\\UnauthorizedHttpException"
}
Status 403
Current user can't access this page
{
"name": "Forbidden",
"message": "duplicate request OR Current user cant access this page",
"code": "0",
"status": "403",
"type": "yii\\\\web\\\\ForbiddenHttpException"
}
Status 404
User id invalid or deleted
{
"name": "Not Found",
"message": "Object not found: {id}",
"code": "0",
"status": "404",
"type": "yii\\\\web\\\\NotFoundHttpException"
}