Skip to content

Latest commit

 

History

History
60 lines (39 loc) · 3.99 KB

csharp-code-examples-for-submissions-game-options-and-trailers.md

File metadata and controls

60 lines (39 loc) · 3.99 KB
description title ms.date ms.topic keywords ms.localizationpriority
Use the C# code examples in this section to learn more about submitting game options and trailers using the Microsoft Store submission API.
C# sample - app submission with game options and trailers
07/10/2017
article
windows 10, uwp, Microsoft Store submission API, code examples, game options, trailers, advanced listings, C#
medium

C# sample: app submission with game options and trailers

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

  • Obtain an Azure AD access token to use with the Microsoft Store submission API.
  • Create an app submission
  • Configure Store listing data for the app submission, including the gaming and trailers advanced listing options.
  • Upload the ZIP file containing the packages, listing images, and trailer files for the app submission.
  • Commit the app submission.

You can review each example to learn more about the task it demonstrates, or you can build all the code examples in this article into a console application. To build the examples, create a C# console application named DevCenterApiSample in Visual Studio, copy each example to a separate code file in the project, and build the project.

Prerequisites

These examples have the following requirements:

  • Add a reference to the System.Web assembly in your project.
  • Install the Newtonsoft.Json NuGet package from Newtonsoft to your project.

Create an app submission

The CreateAndSubmitSubmissionExample class defines a public Execute method that calls other example methods to use the Microsoft Store submission API to create and commit an app submission that contains game options and a trailer. To adapt this code for your own use:

[!div class="tabbedCodeSnippets"] :::code language="csharp" source="~/../snippets-windows/windows-uwp/monetize/StoreServicesExamples_SubmissionAdvancedListings/cs/CreateAndSubmitSubmissionExample.cs" id="CreateAndSubmitSubmissionExample":::

Obtain an Azure AD access token

The DevCenterAccessTokenClient class defines a helper method that uses the your tenantId, clientId and clientSecret values to create an Azure AD access token to use with the Microsoft Store submission API.

[!div class="tabbedCodeSnippets"] :::code language="csharp" source="~/../snippets-windows/windows-uwp/monetize/StoreServicesExamples_SubmissionAdvancedListings/cs/DevCenterAccessTokenClient.cs" id="DevCenterAccessTokenClient":::

Helper methods to invoke the submission API and upload submission files

The DevCenterClient class defines helper methods that invoke a variety of methods in the Microsoft Store submission API and upload the ZIP file containing the packages, listing images, and trailer files for the app submission.

[!div class="tabbedCodeSnippets"] :::code language="csharp" source="~/../snippets-windows/windows-uwp/monetize/StoreServicesExamples_SubmissionAdvancedListings/cs/DevCenterClient.cs" id="DevCenterClient":::

Related topics