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 |
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
- Create an add-on
- Create a package flight
- Create an app submission
- Create an add-on submission
- Create a package flight submission
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":::
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":::
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":::
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:
- To begin, the example gets data for the specified app.
- Next, it deletes the pending submission for the app, if one exists.
- It then creates a new submission for the app (the new submission is a copy of the last published submission).
- It changes some details for the new submission and upload a new package for the submission to Azure Blob Storage.
- Next, it updates and then commits the new submission to Partner Center.
- 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":::
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:
- To begin, the example gets data for the specified add-on.
- Next, it deletes the pending submission for the add-on, if one exists.
- It then creates a new submission for the add-on (the new submission is a copy of the last published submission).
- 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.
- Next, it updates and then commits the new submission to Partner Center.
- 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":::
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:
- To begin, the example gets data for the specified package flight.
- Next, it deletes the pending submission for the package flight, if one exists.
- It then creates a new submission for the package flight (the new submission is a copy of the last published submission).
- 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.
- Next, it updates and then commits the new submission to Partner Center.
- 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":::