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

WebAPI Returning Empty results intermittently

I've implemented WebAPI for my Power Apps Portal. The Web API is not working as expected for same query sometimes it is returning the empty result set and sometimes it is returning correct data

SagarKonda_0-1664370964964.pngSagarKonda_1-1664370980019.png

 

 

3 REPLIES 3
chleverenz
Super User
Super User

Hi @SagarKonda ,

by writing "I've implemented" do you mean you created  a liquid creating that data you mentioned? Or do you use the standard webapi provided by the portal?

 

When i create apis on my own via liquid, i have to be very careful about escaping double and singlequotes and lessthan/greaterthan signs as well as it is quite clumsy to add conditions to fetches without breaking the logic :-).

 

In both cases, authentication matters. If for some reasons you have the wrong key for asking the page or api, you might see diffrent/no data. For web-api calls you should never cache the value for the security header you are sending. I would recommend always getting a new one.

Just my bits on this and may be a too late answer 🙂

 

Have fun,

  Christian

SagarKonda
Frequent Visitor

@chleverenz 

I'm using standard apis provided by portal still facing the issues.

Could you tell me where can I find whether security headers are being cached and how can I change them 

chleverenz
Super User
Super User

Well, its about the requestverificationtoken. It is not cached at all but sometimes i write accidentially code which caches that sort of things. But if you use a new verificationtoken all the time (and get one 🙂 ) it should not be a problem.

Do you use the examplecode from microsoft  ( https://learn.microsoft.com/en-us/power-apps/maker/portals/web-api-http-requests-handle-errors ) to obtain a token and send the request? That one should work.

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

MPP IDEAS updated 768x460.png

Ideas

Discover ideas and concepts from users like you for how to use Power Pages and take your work to the next level.

Carousel News & Announcements

What's New in the Community?

Check out the latest News & Events in the community!

Users online (3,003)