API Endpoints
1. Create Appointment Rating
Method: POST
Path: /ratings/create
Authentication: No
Description: Creates a new rating entry for an appointment.
Request Body:
{
"customer_id": 1234,
"booking_id": "BKD9927952",
"overall_rating": 4,
"provider_rating": 4,
"staff_rating": 5,
"clinic_rating": 5
}
Response:
{
"success": true,
"message": "Your review rating has been submitted successfully",
}
2. Approve Appointment Rating
Method: PATCH
Path: /ratings/update
Authentication: Yes
Description: Approves a single rating for an appointment.
Headers:
Authorization: Bearer <token>
Request Body:
{
"agent_id": 13,
"booking_id": "390353",
"status": "approve"
}
Response:
{
"success": true,
"message": "This feedback has been successfully approved"
}
3. Approve Multiple Appointment Ratings
Method: PATCH
Path: /ratings/update-multiple
Authentication: Yes
Description: Approves multiple ratings in one request.
Headers:
Authorization: Bearer <token>
Request Body:
{
"agent_id": 13,
"ratings": [
{
"booking_id": "391215",
"status": "approve"
},
{
"booking_id": "391214",
"status": "reject"
},
]
}
Response:
{
"data": [
{
"booking_id": "391215",
"success": true,
"message": "Rating has been successfully approved."
}
{
"booking_id": "391214",
"success": true,
"message": "Rating has been successfully rejected."
}
]
}
4. Get Unapproved Providers' Ratings
Method: GET
Path: /ratings/unapproved
Authentication: Yes
Description: Fetches a paginated list of unapproved provider ratings.
Headers:
Authorization: Bearer <token>
Query Parameters:
page: (default1)limit: (default10)businessLocationId(optional)agentId(optional)
Response:
{
"data": [
{
"id": 9,
"overallRating": 4,
"providerRating": 5,
"staffRating": 2.4,
"clinicRating": 4.4,
"comments": null,
"status": "pending",
"datetimeRated": "2025-04-30T17:21:41.239Z",
"customer": {
"id": "22710",
"firstName": "Jed",
"lastName": "Crist",
"genderIdentity": "Male"
},
"appointment": {
"startDatetime": "2025-03-26T07:20:00.000Z",
"bookingId": "BKD2047825"
},
"businessLocation": {
"id": "1",
"address": "1234 338th Avenue NE"
},
"agent": {
"id": "4",
"firstName": "David",
"lastName": "Cameron",
"imageUrl": "https:/Provider/dev-api.bookadoc.com/cms/provider-images/4-1723730266635dr.provider.webp",
"agentType": {
"id": 6,
"name": "MD"
}
}
}
],
"pagination": {
"total": 1,
"page": 1,
"limit": 5,
"totalPages": 1
}
}
5. Get All Providers' Ratings
Method: GET
Path: /ratings/providers
Authentication: No
Description: Fetches ratings for all providers. Can include comments and limit results.
Query Parameters:
includeComments:trueorfalselimit: number
Response:
[
{
"agent_id": "4",
"average_rating": 4.05,
"overall_count": 2,
"comments": [
{
"comment": "Got a taste",
"rating": 3.1,
"datetime": "2025-04-10T22:23:38.138Z",
"customer": {
"first_name": "John",
"last_name": "Leo"
}
}
]
},
...
]
6. Get Ratings for a Specific Provider
Method: GET
Path: /ratings/provider/:agentId
Authentication: No
Description:
Returns ratings for a specific provider identified by agentId.
Path Parameters:
agentId: number
Query Parameters:
includeComments:trueorfalselimit: numberdeepStats:trueorfalse
Response:
{
"agent_id": "4",
"average_rating": 4.05,
"overall_count": 2,
"comments": [
{
"comment": "Got a taste",
"rating": 3.1,
"datetime": "2025-04-10T22:23:38.138Z",
"customer": {
"first_name": "John",
"last_name": "Leo"
}
},
...
],
"deep_stats": {
"total5Star": 1,
"total4Star": 0,
"total3Star": 1,
"total2Star": 0,
"total1Star": 0
}
}
7. Get Rating Appointment Info
Method: GET
Path: /ratings/appointment/:token
Authentication: No
Description: Retrieves appointment information used for rating via a unique token.
Path Parameters:
token: string
Response:
{
"bookingId": "BKD3674037",
"startDatetime": "2024-09-06T08:40:00.000Z",
"customerId": "1",
"agent": {
"id": "4",
"name": "MD David Provider",
"imageUrl": "https://dev-api.bookadoc.com/cms/provider-images/4-1723730266635dr.provider.webp"
}
}