获取所有加载项Get all add-ons

在 Microsoft Store 提交 API 中使用此方法检索到合作伙伴中心帐户注册的所有应用的所有外接程序的数据。Use this method in the Microsoft Store submission API to retrieve data for all add-ons for all the apps that are registered to your Partner Center account.

先决条件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 submission 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.

请求Request

此方法具有以下语法。This method has the following syntax. 请参阅以下部分,获取标头和请求正文的使用示例和描述。See the following sections for usage examples and descriptions of the header and request body.

方法Method 请求 URIRequest URI
GETGET https://manage.devcenter.microsoft.com/v1.0/my/inappproducts

请求头Request header

HeaderHeader 在任务栏的搜索框中键入Type 描述Description
授权Authorization stringstring 必需。Required. Azure AD 访问令牌的格式为 Bearer token<>。The Azure AD access token in the form Bearer <token>.

请求参数Request parameters

此方法的所有请求参数均为选填。All request parameters are optional for this method. 如果不填写参数即调用此方法,则响应将包含注册到帐户的所有应用的所有加载项数据。If you call this method without parameters, the response contains data for all add-ons for all apps that are registered to your account.

参数Parameter 在任务栏的搜索框中键入Type 描述Description 必需Required
toptop intint 要在请求中返回的项数(即,要返回的加载项数)。The number of items to return in the request (that is, the number of add-ons to return). 如果帐户具有的加载项超过在查询中指定的值,响应正文将包括可追加到方法 URI 的相对 URI 路径,用于请求下一页数据。If your account has more add-ons than the value you specify in the query, the response body includes a relative URI path that you can append to the method URI to request the next page of data. No
skipskip intint 返回剩余项之前,在查询中绕过的项数。The number of items to bypass in the query before returning the remaining items. 使用此参数分页浏览数据集。Use this parameter to page through data sets. 例如,top=10 和 skip=0 可检索项目 1 到 10,top=10 和 skip=10 可检索项目 11 到 20,依此类推。For example, top=10 and skip=0 retrieves items 1 through 10, top=10 and skip=10 retrieves items 11 through 20, and so on. No

请求正文Request body

请勿为此方法提供请求正文。Do not provide a request body for this method.

请求示例Request examples

以下示例演示了如何检索注册到帐户的所有应用的所有加载项数据。The following example demonstrates how to retrieve all add-on data for all the apps that are registered to your account.

GET https://manage.devcenter.microsoft.com/v1.0/my/inappproducts HTTP/1.1
Authorization: Bearer <your access token>

以下示例演示了如何仅检索前 10 个加载项。The following example demonstrates how to retrieve the first 10 add-ons only.

GET https://manage.devcenter.microsoft.com/v1.0/my/inappproducts?top=10 HTTP/1.1
Authorization: Bearer <your access token>

响应Response

以下示例演示了注册到开发人员帐户前 5 个加载项(加载项总数为 1072 个)的成功请求返回的 JSON 响应正文。The following example demonstrates the JSON response body returned by a successful request for the first 5 add-ons that are registered to a developer account with 1072 total add-ons. 为简便起见,此示例仅显示该请求返回的前两个加载项。For brevity, this example only shows the data for the first two add-ons returned by the request. 有关响应正文中这些值的详细信息,请参阅以下部分。For more details about the values in the response body, see the following section.

{
  "@nextLink": "inappproducts/?skip=5&top=5",
  "value": [
    {
      "applications": {
        "value": [
          {
            "id": "9NBLGGH4R315",
            "resourceLocation": "applications/9NBLGGH4R315"
          }
        ],
        "totalCount": 1
      },
      "id": "9NBLGGH4TNMP",
      "productId": "a8b8310b-fa8d-4da0-aca0-577ef6dce4dd",
      "productType": "Consumable",
      "pendingInAppProductSubmission": {
        "id": "1152921504621243619",
        "resourceLocation": "inappproducts/9NBLGGH4TNMP/submissions/1152921504621243619"
      },
      "lastPublishedInAppProductSubmission": {
        "id": "1152921504621243705",
        "resourceLocation": "inappproducts/9NBLGGH4TNMP/submissions/1152921504621243705"
      }
    },
    {
      "applications": {
        "value": [
          {
            "id": "9NBLGGH4R315",
            "resourceLocation": "applications/9NBLGGH4R315"
          }
        ],
        "totalCount": 1
      },
      "id": "9NBLGGH4TNMN",
      "productId": "6a3c9788-a350-448a-bd32-16160a13018a",
      "productType": "Consumable",
      "pendingInAppProductSubmission": {
        "id": "1152921504621243538",
        "resourceLocation": "inappproducts/9NBLGGH4TNMN/submissions/1152921504621243538"
      },
      "lastPublishedInAppProductSubmission": {
        "id": "1152921504621243106",
        "resourceLocation": "inappproducts/9NBLGGH4TNMN/submissions/1152921504621243106"
      }
    },

  // Other add-ons omitted for brevity...
  ],
  "totalCount": 1072
}

响应正文Response body

Value 在任务栏的搜索框中键入Type 描述Description
@nextLink stringstring 如果存在数据的其他页,此字符串中包含可附加到基本 https://manage.devcenter.microsoft.com/v1.0/my/ 请求 URI 的相对路径,用于请求下一页数据。If there are additional pages of data, this string contains a relative path that you can append to the base https://manage.devcenter.microsoft.com/v1.0/my/ request URI to request the next page of data. 例如,如果初始请求正文的 top 参数设置为 10,但有 100 个加载项注册到你的帐户,响应正文将包含 inappproducts?skip=10&top=10 的 @nextLink 值,指示你可以调用 https://manage.devcenter.microsoft.com/v1.0/my/inappproducts?skip=10&top=10 请求接下来的 10 个加载项。For example, if the top parameter of the initial request body is set to 10 but there are 100 add-ons registered to your account, the response body will include a @nextLink value of inappproducts?skip=10&top=10, which indicates that you can call https://manage.devcenter.microsoft.com/v1.0/my/inappproducts?skip=10&top=10 to request the next 10 add-ons.
value 数组array 包含提供有关每个加载项信息的对象的数组。An array that contains objects that provide information about each add-on. 有关详细信息,请参阅加载项资源For more information, see add-on resource.
totalCounttotalCount intint 响应正文的 value 数组中的应用对象数。The number of app objects in the value array of the response body.

错误代码Error codes

如果无法成功完成请求,该响应中会包含以下 HTTP 错误代码之一。If the request cannot be successfully completed, the response will contain one of the following HTTP error codes.

错误代码Error code 描述Description
404404 找不到任何加载项。No add-ons were found.
409409 应用程序或外接程序使用合作伙伴中心功能目前不支持通过 Microsoft Store 提交 APIThe apps or add-ons use Partner Center features that are currently not supported by the Microsoft Store submission API.