Skip to content

Latest commit

 

History

History
92 lines (61 loc) · 6.54 KB

python-code-examples-for-the-windows-store-submission-api.md

File metadata and controls

92 lines (61 loc) · 6.54 KB
ms.assetid description title ms.date ms.topic keywords ms.localizationpriority
8AC56AAF-8D8C-4193-A6B3-BB5D0669D994
Use the Python code examples in this section to learn more about using the Microsoft Store submission API.
Python code to submit apps, add-ons, and flights
04/21/2022
article
windows 10, uwp, Microsoft Store submission API, code examples, python
medium

Python sample: submissions for apps, add-ons, and flights

This article provides Python code examples that demonstrate how to use the Microsoft Store submission API for these tasks:

Obtain an Azure AD access token

The following example demonstrates how to obtain an Azure AD access token that you can use to call methods in the Microsoft Store submission API. After you obtain a token, you have 60 minutes to use this token in calls to the Microsoft Store submission API before the token expires. After the token expires, you can generate a new token..

:::code language="python" source="~/../snippets-windows/windows-uwp/monetize/StoreServicesExamples_Submission/python/Examples.py" range="1-20":::

Create an add-on

The following example demonstrates how to create and then delete an add-on.

:::code language="python" source="~/../snippets-windows/windows-uwp/monetize/StoreServicesExamples_Submission/python/Examples.py" range="26-52":::

Create a package flight

The following example demonstrates how to create and then delete a package flight.

:::code language="python" source="~/../snippets-windows/windows-uwp/monetize/StoreServicesExamples_Submission/python/Examples.py" range="58-87":::

Create an app submission

The following example shows how to use several methods in the Microsoft Store submission API to create an app submission. To do this, the code creates a new submission as a clone of the last published submission, and then updates and commits the cloned submission to Partner Center. Specifically, the example performs these tasks:

  1. To begin, the example gets data for the specified app.
  2. Next, it deletes the pending submission for the app, if one exists.
  3. It then creates a new submission for the app (the new submission is a copy of the last published submission).
  4. It changes some details for the new submission and upload a new package for the submission to Azure Blob Storage.
  5. Next, it updates and then commits the new submission to Partner Center.
  6. Finally, it periodically checks the status of the new submission until the submission is successfully committed.

:::code language="python" source="~/../snippets-windows/windows-uwp/monetize/StoreServicesExamples_Submission/python/Examples.py" range="93-166":::

Create an add-on submission

The following example shows how to use several methods in the Microsoft Store submission API to create an add-on submission. To do this, the code creates a new submission as a clone of the last published submission, and then updates and commits the cloned submission to Partner Center. Specifically, the example performs these tasks:

  1. To begin, the example gets data for the specified add-on.
  2. Next, it deletes the pending submission for the add-on, if one exists.
  3. It then creates a new submission for the add-on (the new submission is a copy of the last published submission).
  4. It uploads a ZIP archive that contains icons for the submission to Azure Blob Storage. For more information, see the relevant instructions about uploading a ZIP archive to Azure Blob Storage in Create an add-on submission.
  5. Next, it updates and then commits the new submission to Partner Center.
  6. Finally, it periodically checks the status of the new submission until the submission is successfully committed.

:::code language="python" source="~/../snippets-windows/windows-uwp/monetize/StoreServicesExamples_Submission/python/Examples.py" range="172-245":::

Create a package flight submission

The following example shows how to use several methods in the Microsoft Store submission API to create a package flight submission. To do this, the code creates a new submission as a clone of the last published submission, and then updates and commits the cloned submission to Partner Center. Specifically, the example performs these tasks:

  1. To begin, the example gets data for the specified package flight.
  2. Next, it deletes the pending submission for the package flight, if one exists.
  3. It then creates a new submission for the package flight (the new submission is a copy of the last published submission).
  4. It uploads a new package for the submission to Azure Blob Storage. For more information, see the relevant instructions about uploading a ZIP archive to Azure Blob Storage in Create a package flight submission.
  5. Next, it updates and then commits the new submission to Partner Center.
  6. Finally, it periodically checks the status of the new submission until the submission is successfully committed.

:::code language="python" source="~/../snippets-windows/windows-uwp/monetize/StoreServicesExamples_Submission/python/Examples.py" range="251-325":::

Related topics