I am trying to retrieve the billing data from the Partner Central through API call
But firstly i'll need some kind of a access_token
From the documentation I got that with executing following Powershell code
$credential = Get-Credential
$token = New-PartnerAccessToken -Consent -Credential $credential -Resource https://api.partnercenter.microsoft.com -ServicePrincipal
I will get a refresh token and can execute this Powershell code to retrieve the Token
$refreshToken = 'Enter the refresh token value here'
$credential = Get-Credential
$pcToken = New-PartnerAccessToken -RefreshToken $refreshToken -Resource https://api.partnercenter.microsoft.com -Credential $credential -ServicePrincipal
Connect-PartnerCenter -AccessToken $pcToken.AccessToken -AccessTokenExpiresOn $pcToken.ExpiresOn -ApplicationId $appId
But I can't seem to retrieve the refresh token (first PS commands). When i execute the code I'll get Get-Credential login screen where I fill in my Client_ID and Client_secret. Afterwords I'll get a azure login page where I fill in my Credentials.
But I keep to get this error:
![]()
Even when I add the URL "https://api.partnercenter.microsoft.com/" in my Azure AD application settings, in the setting redirect URL's:
![]()
Is there some kind of permission I forgot to give to access the token ?
Or do I miss an obvious step ?