取得所有附加元件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

標頭Header 類型Type 描述Description
AuthorizationAuthorization 字串string 必要。Required. 在表單中的 Azure AD 存取權杖持有人 <語彙基元>。The Azure AD access token in the form Bearer <token>.

要求參數Request parameters

對於此方法而言,所有的要求參數都是選用的。All request parameters are optional for this method. 如果您呼叫這個不含參數的方法,回應會包含已登錄到您帳戶之所有 App 的所有附加元件的資料。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 整數int 要求中要傳回的項目數目 (也就是要傳回的附加元件數目)。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 整數int 在傳回剩餘項目之前要略過的項目數目。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

下列範例示範如何擷取已登錄到您帳戶之所有 App 的所有附加元件資料。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. 為求簡潔,這個範例僅會顯示由要求所傳回之前 2 個附加元件的資料。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 字串string 如果還有其他資料頁面,此字串包含您可以附加到基本 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,但是 App 有 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.
valuevalue 陣列array 包含提供每個附加元件相關資訊之物件的陣列。An array that contains objects that provide information about each add-on. 如需詳細資訊,請參閱附加元件資源For more information, see add-on resource.
totalCounttotalCount 整數int 回應內文的 value 陣列中的 App 物件數目。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.