Update User Data
Update Contact Phone number
Note: This a server-server API, you can't use it from the client-side.
For updating Contact phone number linked to main account you have to call register API and provide the new phone number and the unique identifier for the user.
Check the example:
Note: This a server-server API, you can't use it from the client-side.
curl --location 'registerAPI' \
--header 'access-token: SERVER_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"policy_number": "111111111",
"phone_number": "+966123456789",
"insurance_id": "123123123",
}'
Update User Data
Update User Example
For updating any user data you need to use the updateUser and provide a data object User and the id for that user
Check the example:
import AltibbiTelehealth
let userId = 999999999
var updatedUser = User(id: userId)
updatedUser.email = "[email protected]"
ApiService.updateUser(id: userId, userData: updatedUser, completion: {user, failure, error in
// Handle user as a User object
if let error = error {
print("Data Error: \(String(describing: error))")
} else if let failure = failure {
// Handle failure
} else {
if let user = user {
print("User updated: \(String(describing: user.email))")
}
}
})
Responses
Status 200
Success
{
"id": 999999999,
"name": "Altibbi User",
"email": "[email protected]",
"date_of_birth": "2000-01-30",
"gender": "male",
"insurance_id": "123123123",
"policy_number": "111111111",
"nationality_number": "11110000",
"height": 180,
"weight": 90,
"blood_type": "A+",
"smoker": "yes",
"alcoholic": "no",
"maritalStatus": "single",
"relation_type": "personal"
}
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": "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"
}
Status 422
Data Validation Failed.
[
{
"field": "string",
"message": "string"
}
]