Skip to main content

Rate Consultation

Rate Consultation Example

You can use the rateConsultation method to rate a doctor with providing the consultationId and rating value.


Check the example:

```kotlin
import com.altibbi.telehealth.ApiService

ApiService.rateConsultation(id, 4, object : ApiCallback<Boolean> {
override fun onSuccess(response: Boolean) {
// Response = True means Consultation is rated
}

override fun onFailure(error: String?) {
}

override fun onRequestError(error: String?) {
}
})

Responses

The rateConsultation will return true if the consultation is rated successfully

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 cant rate this consultation

{
"name": "Forbidden",
"message": "duplicate request OR Current user cant access this page",
"code": "0",
"status": "403",
"type": "yii\\\\web\\\\ForbiddenHttpException"
}

Status 404

Consultation id invalid or deleted

{
"name": "Not Found",
"message": "Object not found: {id}",
"code": "0",
"status": "404",
"type": "yii\\\\web\\\\NotFoundHttpException"
}