web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Unauthorized error HTT...
Power Automate
Unanswered

Unauthorized error HTTPS request to partner center API

(0) ShareShare
ReportReport
Posted on by 57

For my company i am building an app which enables us to create user accounts on our MSP tenants.

I am struggling however to understand which permissions i need in the Authentication and Token sequences using a web api in our Azure AD.

I am getting an "unauthorized" error and fail to understand why.

KennethKok_0-1654695697527.png

 

I have created an API registration according to the Microsoft documentation with the following permissions:

KennethKok_1-1654695856843.png

Created scopes:

KennethKok_2-1654695909750.png

And created an Enterprise application, although i am not sure if i need this.

Now i think im going wrong somewhere in the url to create an Auth token with the scope User Impersonation which gives the access to the Partner Center API, but again i am not sure: (tenant ID partly masked in this post for privacy reasons)

https://login.microsoftonline.com/XXXXXXX8328-44a9-9536-7d7f3d9e4410/oauth2/v2.0/authorize?client_id=f319f3f1-73c8-440e-8e35-09e50455364f 
&response_type=code
&redirect_uri=https%3A%2F%2Flogin.microsoftonline.com%2Fcommon%2Foauth2%2Fnativeclient
&response_mode=query
&scope=api://f319f3f1-73c8-440e-8e35-09e50455364f/user_impersonation
&state=12345

 

An Auth token is succesfully created aswell as using that token in a flow with the Refresh token step. 

Using the refresh token in the HTTP request to call the Partner center API is where it goes wrong as seen in the first screenshot.

 

So what am i missing and/or doing wrong ?

I have found alot of sites and documents about Microsoft Graph (and Partnercenter API) with PS, JAVA, REST API's but none which explain how to properly use it in Power Automate.

 

Categories:
I have the same question (0)
  • da1ve Profile Picture
    340 on at

    Hi @KennethKok ,

     

    Did you manage to get anywhere with this? I think I am at a similar stage. This is my flow:

     

    da1ve_0-1661422326035.png

     

    da1ve_1-1661422426810.png

     

    da1ve_2-1661422462038.png

    I don't know how to use the token from above in the flow below?

     

    da1ve_3-1661422489695.png

     

    Are we stuck at the same stage?

     

    Thanks,

    David

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard