cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Problem with Rest API

Hello, I have a problem with one action in my flow. I try to explain background very generally - I have a SP list (with many fields and a lot of items) and a flow (access rights) which is triggered by When HTTP request is received (next action is Get Item and other steps below is set permission levels with Rest API). At first all was working, then I had a problem with lookup fields (I have much more that 12 lookup field in list). This problem was resolved with limited view with less than 12 lookup field. ( I added Limited view to Get item action) But now I have other problem in my flow which is not working after that. In one action (ensure user and set permission level) after refreshing Variables value I receive after run an error 400 “The query string \”logonName\” is missing or invalid (API Method – POST, Uri – _api/web/EnsureUser(@v)?@v=’@{variables(‘BusinessOwnerClaim’)}’) Strange thing for me is that I have 3 similar actions in there (ensure user and set permission level) to set permissions to different persons (fields). After added limited view, problem appeared in one action. Then I refreshed Variables value in second action and this was also causing the problem there. But one the action which I didn’t refreshed, is working. Not at all sure if my description is understandable at all, but maybe someone have some thoughts what it might be or what to try to resolve it Is it something what can be commented on the basis on this information? Or if not I’m happy to answer additional questions 😊

Big thanks in advance, K

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User II
Super User II

Re: Problem with Rest API

Hi @Kadi 

 

The screenshot helps a lot thank you!

 

Are you encoding the request? Everything after the @v should be encoded like:

@v=%27i%3A0%23.f%7Cmemb‌​ership|user@domain.c‌​om%27

 

You can use the https://www.urldecoder.org/ to test it.

 

Can you please check if and let me know if you have any questions?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

View solution in original post

6 REPLIES 6
Highlighted
Super User II
Super User II

Re: Problem with Rest API

Hi @KT100 

 

Sorry, but I got a little bit confused with all the descriptions 😀.

 

Can you please share the Power Automate and obfuscate anything private that you can't share so that I can have a better understanding of what you're trying to do and the issues.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Highlighted
Frequent Visitor

Re: Problem with Rest API

Thank you @manuelstgomes for your reply.

I know my explanation was not so clear. I tried to add a picture of my flow here, but unfortunately I do not have a permission to upload images here. Is there some other way I can share my flow with you? Via email for example?

Thank you again 🙂

 

Highlighted
New Member

Re: Problem with Rest API

Hi again @manuelstgomes . I found the way to upload image 🙂

So here is my flow:

 

Kadi_0-1598003271799.png

Kadi_1-1598003338840.png

 

And here is problem:

ERROR after Run:

{

  "status"400,

  "message""The query string \"logonName\" is missing or invalid.\r\nclientRequestId: 8b716cad-9ab6-41a7-a300-e8aa77c192c9\r\nserviceRequestId: 2d0a6d9f-7073-a000-7641-f08097afb44b",

  "source""https://.....................sharepoint.com/sites/...................../_api/web/EnsureUser(@v)?@v='i:0#.f%7Cmembership%7C....................@......................com'",

  "errors": [

    "-1",

    "Microsoft.SharePoint.Client.InvalidClientQueryException"

  ]

}

 

And as I mentioned in my first post that this error appeared after I added a view to Get Item action (Limit columns by view)

 

Hopefully you understand better now. If you have more questions, I'm happy to answer them 🙂

Thanks again,

Kadi

Highlighted
Super User II
Super User II

Re: Problem with Rest API

Hi @Kadi 

 

The screenshot helps a lot thank you!

 

Are you encoding the request? Everything after the @v should be encoded like:

@v=%27i%3A0%23.f%7Cmemb‌​ership|user@domain.c‌​om%27

 

You can use the https://www.urldecoder.org/ to test it.

 

Can you please check if and let me know if you have any questions?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

View solution in original post

Highlighted
Frequent Visitor

Re: Problem with Rest API

Hi @manuelstgomes 

Yes, You are right. Problem is encoding. 

Thanks,
Kadi
 
Highlighted
New Member

Re: Problem with Rest API

How did you fix the encoding issue? I am getting an error message 

The query string loginName is missing or invalid.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Users online (4,199)