- Article
- 8 minutes to read
Use oMicrosoft Store Shipping APIto programmatically view and create shipments for apps, add-ons, and flight packages to your account or your organization's Partner Center account. This API is useful when your account manages many applications or plugins and you want to automate and simplify the process of delivering these assets. This API uses Azure Active Directory (Azure AD) to authenticate calls from your application or service.
The following steps outline the end-to-end process of using the Microsoft Store Shipping API:
- Make sure you have filled them all in.requirements.
- Before calling any method on the Microsoft Store Shipping API,Get an access token from Azure AD. After receiving a token, you have 60 minutes to use it in Microsoft Store Shipping API calls before the token expires. After the token expires, you can generate a new token.
- Call the Microsoft Store Shipping API.
Important
If you use this API to create a shipment for an app, flight package, or add-on, please make sure you make additional changes to the shipment through the API and not in Partner Center. If you use Partner Center to modify a shipment originally created using the API, you will no longer be able to modify or confirm that shipment using the API. In some cases, the submission may remain in an error state where the submission process cannot continue. In that case, you must delete the shipment and create a new one.
Important
You may not use this API to send submissions toPurchase volume through Microsoft Store for Business and Microsoft Store for Educationor to post posts toLOB Applicationsdirectly to companies. Both scenarios require you to post the shipment in Partner Center.
to use
This API cannot be used with apps or plugins that use required app updates and store-managed consumable plugins. When you use the Microsoft Store Shipping API with an app or plug-in that uses any of these features, the API returns a 409 error code. -in.
Step 1: Meet the requirements to use the Microsoft Store Shipping API
Before you start writing code to call the Microsoft Store Shipping API, make sure you've completed the following prerequisites.
You (or your organization) must have an Azure AD directory and must haveglobal adminPermission on the directory. If you already use Microsoft 365 or other commercial Microsoft services, you already have the Azure AD directory. otherwise you canCreate a new Azure AD in Partner Centerbook.
You needAssociate an Azure AD application with your Partner Center accountand get your tenant ID, customer ID and password. You need these values to obtain an access token from Azure AD that you use in Microsoft Store Shipping API calls.
Prepare your app for use with the Microsoft Store Shipping API:
If your app isn't already in Partner Center, you should be.Build your app by reserving your name in Partner Center. You cannot use the Microsoft Store Shipping API to create an app in Partner Center; You need to work in Partner Center to create it, and then you can use the API to access the app and programmatically create shipments for it. However, you can use the API to create plugins and programmatically ship packages before creating shipments for them.
(Video) S01E03 - Setting up the Store for Business in your Microsoft Intune Tenant - (I.T)Before you can use this API to create a submission for a specific application, you must firstCreate an app submission in Partner Center, including the answer toage ratingsQuiz. You can use the API to programmatically create new submissions for this application. You don't need to create an additional shipment or flight pack shipment before using the API for these types of shipments.
If you create or update an app submission and need to add an app package,Prepare application package.
If you are creating or updating an app submission and need to add screenshots or images for the Play Store listing,Prepare application screenshots and screenshots..
If you are creating or updating an additional shipment and need to add an icon,prepare the icon.
How to link an Azure AD application to your Partner Center account
Before you can use the Microsoft Store Shipping API, you must associate an Azure AD app with your Partner Center account, obtain the Tenant ID and Customer ID for the app, and generate a key. The Azure AD app represents the app or service from which you want to call the Microsoft Store Shipping API. You need the tenant ID, customer ID, and key to get an access token from Azure AD that you pass to the API.
to use
You only need to do this task once. Once you have your tenant ID, customer ID and key, you can reuse them whenever you need to create a new Azure AD access token.
I'm a partner centerLink your organization's Partner Center account to your organization's Azure AD directory.
(Video) The new Microsoft Store built for your success | BRK31following thefrom the userpage noAccount SettingsPartner Center Section,Add the Azure AD applicationrepresenting the application or service you use to access submissions from your Partner Center account. Make sure to assign to this appManagerPaper. If the app doesn't already exist in your Azure AD directory, you canCreate a new Azure AD application in Partner Center.
Back tofrom the userOn the page, click on the name of the Azure AD application to access the application settings and copy theprisoner identificationYClient IDValues.
give a clickadd new key. On the next screen, copy theI likeValue. Once you leave this page, you will no longer be able to access this information. For more information, seeManage keys for an Azure AD application.
Step 2 - Get an access token from Azure AD
Before calling any of the methods in the Microsoft Store Shipping API, you must first obtain an access token from Azure AD which you pass to thepermissionHeader of each method in the API. After receiving an access token, you have 60 minutes to use it before it expires. After the token expires, you can update it to continue using it in future API calls.
To obtain the access token, follow the instructions atService-to-service calls with customer credentialsto send an HTTP POST to thehttps://login.microsoftonline.com/<id_inquilino>/oauth2/token
final point Here is an example request.
POST https://login.microsoftonline.com/<tenant_id>/oauth2/token HTTP/1.1Host: login.microsoftonline.comContent-Type: application/x-www-form-urlencoded; charset=utf-8grant_type=client_credentials&client_id=<your_client_id>&client_secret=<your_client_secret>&resource=https://manage.devcenter.microsoft.com
For theTenant_IDvalue no POST URI is oClient IDYsecret_clientProvide the Tenant ID, Customer ID and key for your app that you got from Partner Center in the previous section. For theResourceYou must specify parametershttps://manage.devcenter.microsoft.com
.
After your access token expires, you can get a new one by making the same HTTP call again.
For examples that demonstrate how to obtain an access token using C#, Java, or Python code, see the Microsoft Store Shipping API.code samples.
Once you get an access token from Azure AD, you can call methods on the Microsoft Store Shipping API. The API contains many methods grouped into scenarios for apps, plugins and flight packages. To create or update shipments, you typically call multiple methods in the Microsoft Store Shipping API on a specific order. For information about each scenario and the syntax of each method, see the articles in the following table. to use After receiving an access token, you have 60 minutes to call methods on the Microsoft Store Shipping API before the token expires. The following articles provide detailed code examples that demonstrate how to use the Microsoft Store Shipping API in several different programming languages: As an alternative to calling the Microsoft Store Shipping API directly, we also provide an open source PowerShell module that implements a command line interface on top of the API. This module is calledstore broker. You can use this module to manage your app submissions, flights and addons from the command line instead of calling the Microsoft Store Submission API directly, or simply explore the source for more examples of this API call. The StoreBroker engine is actively used at Microsoft as the primary method by which many first-party apps are submitted to the Store. For more information, see ourStoreBroker page on GitHub. If you have questions about the Microsoft Store Shipping API or need help managing your shipping using this API, please use the following resources:Step 3 - Use the Microsoft Store Shipping API
road map Description Forms Get data for all apps registered with your Partner Center account and create app submissions. For more information about these methods, see the following articles: Complements Get, create, or remove plugins for your applications and get, create, or remove shipping plugins. For more information about these methods, see the following articles: flight packages Get, create, or delete flight packages for your apps, then get, create, or delete shipments for flight packages. For more information about these methods, see the following articles: code samples
Módulo StoreBroker PowerShell
Problems solution
Production resolution After calling the Microsoft Store Shipping API from PowerShell, the API response data is corrupted when you convert it from JSON format to a PowerShell object usingConvertFrom-Jsoncmdlet and then back to JSON format with theConvertTo-Jsoncmdlet. By default, the-Depthparameters for theConvertTo-JsonThe cmdlet is set to 2 object levels, which is too shallow for most JSON objects returned by the Microsoft Store Shipping API. if you call themConvertTo-Jsoncmdlet, enter the-Depthparameter to a larger number, p. B 20 extra help