提交评价回复Submit responses to reviews

在 Microsoft Store 评价 API 中使用此方法,以编程方式回复应用评价。Use this method in the Microsoft Store reviews API to programmatically respond to reviews of your app. 调用此方法时,必须指定要回复的评价 ID。When you call this method, you must specify the IDs of the reviews you want to respond to. 评价 ID 位于 Microsoft Store 分析 API 中的获取应用评价方法的回复数据中,以及评价报告脱机下载中。Review IDs are available in the response data of the get app reviews method in the Microsoft Store analytics API and in the offline download of the Reviews report.

当客户提交评价时,他们可以选择不接收对其评价的回复。When a customer submits a review, they can choose not to receive responses to their review. 如果你尝试回复客户已选择不接收回复的评价,此方法的回复正文将显示回复尝试未成功。If you try to respond to a review for which the customer chose not to receive responses, the response body of this method will indicate that the response attempt was unsuccessful. 调用此方法前,你可以选择使用获取应用评价的回复信息方法确定是否可以回复给定评价。Before calling this method, you can optionally determine whether you are allowed to respond to a given review by using the get response info for app reviews method.

备注

除了使用此方法以编程方式响应评审,你还可以 使用合作伙伴中心来响应评审。In addition to using this method to programmatically respond to reviews, you can alternatively respond to reviews using Partner Center.

必备条件Prerequisites

若要使用此方法,首先需要执行以下操作:To use this method, you need to first do the following:

  • 如果尚未开始操作,请先完成 Microsoft Store 评价 API 的所有先决条件If you have not done so already, complete all the prerequisites for the Microsoft Store reviews API.
  • 获取 Azure AD 访问令牌,以供在此方法的请求标头中使用。Obtain an Azure AD access token to use in the request header for this method. 获取访问令牌后,在它到期前,你有 60 分钟的使用时间。After you obtain an access token, you have 60 minutes to use it before it expires. 该令牌到期后,可以获取新的令牌。After the token expires, you can obtain a new one.
  • 获取要回复的评价的 ID。Get the IDs of the reviews you want to respond to. 评价 ID 位于 Microsoft Store 分析 API 中的获取应用评价方法的回复数据中,以及评价报告脱机下载中。Review IDs are available in the response data of the get app reviews method in the Microsoft Store analytics API and in the offline download of the Reviews report.

请求Request

请求语法Request syntax

方法Method 请求 URIRequest URI
POSTPOST https://manage.devcenter.microsoft.com/v1.0/my/reviews/responses

请求头Request header

HeaderHeader 类型Type 说明Description
授权Authorization 字符串string 必需。Required. Azure AD 访问令牌的格式为 Bearer <token> 。The Azure AD access token in the form Bearer <token>.

请求参数Request parameters

此方法没有请求参数。This method has no request parameters.

请求正文Request body

请求正文具有以下值。The request body has the following values.

“值”Value 类型Type 说明Description
响应Responses arrayarray 包含要提交的回复数据的对象数组。An array of objects that contain the response data you want to submit. 有关每个对象中的数据的详细信息,请参阅下表。For more information about the data in each object, see the following table.

Responses 数组中的每个对象包含以下值。Each object in the Responses array contains the following values.

“值”Value 类型Type 说明Description 必需Required
ApplicationIdApplicationId 字符串string 要回复评价的应用的应用商店 ID。The Store ID of the app with the review you want to respond to. 可以在合作伙伴中心的 " 应用标识" 页 上获取应用商店 ID。The Store ID is available on the App identity page of Partner Center. Store ID 示例:9WZDNCRFJ3Q8。An example Store ID is 9WZDNCRFJ3Q8. Yes
ReviewIdReviewId 字符串string 要回复的评价 ID(这是一个 GUID)。The ID of the review you want to respond to (this is a GUID). 评价 ID 位于 Microsoft Store 分析 API 中的获取应用评价方法的回复数据中,以及评价报告脱机下载中。Review IDs are available in the response data of the get app reviews method in the Microsoft Store analytics API and in the offline download of the Reviews report. Yes
ResponseTextResponseText 字符串string 要提交的回复。The response you want to submit. 你的回复必须遵循以下准则Your response must follow these guidelines. Yes
SupportEmailSupportEmail 字符串string 应用的支持电子邮件地址,客户可以用它来直接与你联系。Your app's support email address, which the customer can use to contact you directly. 必须为有效的电子邮件地址。This must be a valid email address. Yes
IsPublicIsPublic 布尔值Boolean 如果指定 " true",则响应将显示在应用商店列表中,直接在客户评审的下方显示,并对所有客户可见。If you specify true, your response will be displayed in your app's Store listing, directly below the customer's review, and will be visible to all customers. 如果指定 false ,并且用户未选择接收电子邮件响应,你的响应将通过电子邮件发送给客户,而你的应用商店列表中的其他客户将看不到此响应。If you specify false and the user hasn't opted out of receiving email responses, your response will be sent to the customer via email, and it will not be visible to other customers in your app's Store listing. 如果指定 false ,并且用户已选择不接收电子邮件响应,则将返回错误。If you specify false and the user has opted out of receiving email responses, an error will be returned. Yes

请求示例Request example

以下示例演示了如何使用此方法提交多个评价的回复。The following example demonstrates how to use this method to submit responses to several reviews.

POST https://manage.devcenter.microsoft.com/v1.0/my/reviews/responses HTTP/1.1
Authorization: Bearer <your access token>
Content-Type: application/json
{
  "Responses": [
    {
      "ApplicationId": "9WZDNCRFJ3Q8",
      "ReviewId": "6be543ff-1c9c-4534-aced-af8b4fbe0316",
      "ResponseText": "Thank you for pointing out this bug. I fixed it and published an update, you should have the fix soon",
      "SupportEmail": "support@contoso.com",
      "IsPublic": true
    },
    {
      "ApplicationId": "9NBLGGH1RP08",
      "ReviewId": "80c9671a-96c2-4278-bcbc-be0ce5a32a7c",
      "ResponseText": "Thank you for submitting your review. Can you tell more about what you were doing in the app when it froze? Thanks very much for your help.",
      "SupportEmail": "support@contoso.com",
      "IsPublic": false
    }
  ]
}

响应Response

响应正文Response body

Value 类型Type 说明Description
结果Result arrayarray 包含每个已提交回复的相关数据的对象数组。An array of objects that contain data about each response you submitted. 有关每个对象中的数据的详细信息,请参阅下表。For more information about the data in each object, see the following table.

Result 数组中的每个对象包含以下值。Each object in the Result array contains the following values.

“值”Value 类型Type 说明Description
ApplicationIdApplicationId 字符串string 已回复评价的应用的应用商店 ID。The Store ID of the app with the review you responded to. Store ID 示例:9WZDNCRFJ3Q8。An example Store ID is 9WZDNCRFJ3Q8.
ReviewIdReviewId 字符串string 已回复评价的 ID。The ID of the review you responded to. 这是一个 GUID。This is a GUID.
成功Successful 字符串string true 表示你的回复已发送成功。The value true indicates that your response was sent successfully. false 表示你的回复失败。The value false indicates that your response was unsuccessful.
FailureReasonFailureReason stringstring 如果 Successfulfalse,此值包含失败的原因。If Successful is false, this value contains a reason for the failure. 如果 Successfultrue,此值为空。If Successful is true, this value is empty.

响应示例Response example

以下示例举例说明此请求的 JSON 响应正文。The following example demonstrates an example JSON response body for this request.

{
  "Result": [
    {
      "ApplicationId": "9WZDNCRFJ3Q8",
      "ReviewId": "6be543ff-1c9c-4534-aced-af8b4fbe0316",
      "Successful": "true",
      "FailureReason": ""
    },
    {
      "ApplicationId": "9NBLGGH1RP08",
      "ReviewId": "80c9671a-96c2-4278-bcbc-be0ce5a32a7c",
      "Successful": "false",
      "FailureReason": "No Permission"
    }
  ]
}