moegoapis

๐Ÿ“ Review API Documentation (moego.business.review.v1)

๐Ÿ“Œ 1. Functional Overview

The Review module provides APIs to manage customer feedback for services provided at your business.

Each review is associated with a specific appointment and can include ratings and comments about multiple staff members and pets. This interface enables:

Useful for scenarios such as analyzing customer satisfaction, evaluating staff performance, and improving service quality.


๐ŸŽฏ 2. Design Goals

Applicable to scenarios like:


๐Ÿงฉ 3. Core Concepts

1. Review

Represents customer feedback submitted after receiving services.

Field Name Type Description
id string Unique identifier (e.g., "rev_001").
customerId string ID of the customer who submitted the review
appointmentId string ID of the appointment being reviewed
staffIds Array(string) IDs of staff members included in the review
petIds Array(string) IDs of pets involved in the reviewed service
source Source Channel through which the review was submitted
score uint32 Customer satisfaction rating (scale: 1โ€“5)
content string Detailed feedback content
reviewTime Timestamp When the review was submitted by the customer
createdTime Timestamp When this review was created in the system
lastUpdatedTime Timestamp When this review was last modified

Enum: Source

Describes how the review was submitted by the customer.


๐Ÿ“ˆ 4. Typical Usage Flow

โœ… Scenario: User Integrates and Debugs Review API

Here is a typical integration flow:

  1. List Reviews
    • Retrieve all reviews for a specific business.
    • Optionally filter by source or staff member.
  2. Monitoring & Analysis
    • Regularly fetch reviews to monitor customer satisfaction.
    • Filter by staff to evaluate performance.
    • Analyze feedback trends by source (e.g., SMS vs. Portal).
  3. Integration with Dashboards
    • Display aggregated review scores.
    • Highlight top/bottom performing staff based on feedback.

๐Ÿ› ๏ธ 5. API Interface Descriptions

1. List Reviews (ListReviews)

โœ… Functionality:

Retrieves a paginated list of customer reviews based on specified criteria.

Supports filtering by feedback source and staff members to facilitate targeted analysis of customer satisfaction and service quality.

๐ŸŽฏ Use Cases:

๐Ÿ”ง Request Parameters:

Field Name Type Required Description
pagination Pagination Yes Page size and token
businessId string Yes Business location ID to scope reviews
filter.sources Array(Source) No Feedback channels to include in results
filter.staffIds Array(string) No Staff members to filter reviews by

๐Ÿ“Œ Return Value:

Field Name Type Description
nextPageToken string Token for retrieving the next page of results
reviews Array(Review) List of reviews matching the request criteria

โš ๏ธ Error Codes:


๐Ÿงช 6. Usage Examples

Example 1: List All Reviews for a Business

Request

POST /v1/reviews:list
Content-Type: application/json

{
  "pagination": {
    "pageSize": 20,
    "pageToken": "1"
  },
  "businessId": "bus_001"
}

Response

{
  "nextPageToken": "CBAQAA==",
  "reviews": [
    {
      "id": "rev_001",
      "customerId": "cus_001",
      "appointmentId": "apt_001",
      "staffIds": [
        "stf_001"
      ],
      "petIds": [
        "pet_001"
      ],
      "source": "PET_PARENT_PORTAL",
      "score": 5,
      "content": "Excellent service! My dog looked amazing.",
      "reviewTime": "2023-09-15T10:00:00Z",
      "createdTime": "2023-09-15T10:05:00Z",
      "lastUpdatedTime": "2023-09-15T10:05:00Z"
    },
    {
      "id": "rev_002",
      "customerId": "cus_002",
      "appointmentId": "apt_002",
      "staffIds": [
        "stf_002"
      ],
      "petIds": [
        "pet_002"
      ],
      "source": "SMS",
      "score": 4,
      "content": "Good experience overall.",
      "reviewTime": "2023-09-16T11:00:00Z",
      "createdTime": "2023-09-16T11:05:00Z",
      "lastUpdatedTime": "2023-09-16T11:05:00Z"
    }
  ]
}

Example 2: Filter Reviews by Source and Staff

Request

POST /v1/reviews:list
Content-Type: application/json

{
  "pagination": {
    "pageSize": 20,
    "pageToken": "1"
  },
  "businessId": "bus_001",
  "filter": {
    "sources": ["SMS", "PET_PARENT_PORTAL"],
    "staffIds": ["stf_001"]
  }
}

Response

{
  "nextPageToken": "",
  "reviews": [
    {
      "id": "rev_001",
      "customerId": "cus_001",
      "appointmentId": "apt_001",
      "staffIds": [
        "stf_001"
      ],
      "petIds": [
        "pet_001"
      ],
      "source": "PET_PARENT_PORTAL",
      "score": 5,
      "content": "Excellent service! My dog looked amazing.",
      "reviewTime": "2023-09-15T10:00:00Z",
      "createdTime": "2023-09-15T10:05:00Z",
      "lastUpdatedTime": "2023-09-15T10:05:00Z"
    }
  ]
}

โš ๏ธ 7. Usage Limitations

TODO


โ“ 8. FAQ

Question Answer
How do I retrieve all reviews for a business? Use ListReviews with the businessId parameter.
Can I filter reviews by multiple staff members? Yes, provide an array of staff IDs in the filter.staffIds field.
How are reviews sorted? Results are typically sorted by reviewTime descending unless otherwise specified.
Why does listing reviews return โ€œpermission deniedโ€? Ensure you have the correct access rights for this operation.
How do I handle large result sets efficiently? Use pagination via pageSize and pageToken.

๐Ÿ“Œ 9. Common Error Codes

Error Code Description
NOT_FOUND The business ID doesnโ€™t exist.
PERMISSION_DENIED Caller lacks access rights.
INVALID_ARGUMENT Invalid request parameters provided.
INTERNAL Internal server error occurred.