cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Alicekings
Helper II
Helper II

Can't get principalId from SharePoint On premise by HTTP Request

Try to get Value principalId from On premise Site by HTTP Request

 

but it Show error 502 bad Gateway on Method Get on other Method work fine like POST PUSH

 

Try it to Online Site it work fine all Method

 

Alicekings_0-1602911953012.pngAlicekings_1-1602912016199.png

6 REPLIES 6
v-litu-msft
Community Support
Community Support

Hi @Alicekings,

 

The parameter in the getByEmail() method should be an email address that type is a string. I can see the dynamic in your screenshot is dateCreate, I guess it is a string of date. Please refer to screenshot as below:

_api/web/SiteUsers/getByEmail('Email1@domain.com')

Screenshot 2020-10-21 130811.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank for reply @v-litu-msft 

 

My "dateCreate"  is email String Value but it didn't work

 

Even I try to Enter email by manual like picture below it end up the same problem

 

Alicekings_0-1603274878742.png

 

Hi @Alicekings,

 

The problem is located in the Site Address, this API is getting the site users, so you should add a site after the domain, or it don't know which site should call:

Screenshot 2020-10-22 161817.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank for reply @v-litu-msft 

 

Sorry, but I don't quite understand can you give me some example of your solution

 

My other Step in this flow use same Address but it work fine I don't know why it only Method Get  fail 

 

Screenshot_3.jpg

 

 

 

 

 

 

Here is my site Address My on premise have only this site didn't have any sub site

 

Screenshot_1.jpg

Hi @Alicekings,

 

You could check the api structure:

SP.UserCollection.getByEmail Method (sp.js) | Microsoft Docs

It contains site name:

http://<sitecollection>/<site>/_api/web/sitegroups(groupid)/users/getByEmail(emailAddress)

 

About your Flow, you could have a try that appends this site address:

https://sitedomain.com/SharepointHybrid

sitedomian should your SharePoint site.

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank for reply @v-litu-msft 

 

I Check out the api structure that you give me however it not work to get On premise data 

 

I try out your solution On Online SharePoint it work fine 

 

But went I try it to my On premise SharePoint it Show error like this 

 

Alicekings_0-1603682691691.png

 

*I use the same Site Address to Use Method POST something to the same Site it work fine . I still don't have a clue why I can't Use Method GET to the same site

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (20,023)