Calling API Endpoints from Dynamic Regions

Product: PowerShell Universal
Version: 4.2.20

Hey everyone,

We’re having a strange issue. When calling an API endpoint from anything dynamic, we’re seeing strange results.

Two Examples:

  1. First one is a password reset from a Form. We’re calling http://url:5463/endpointname?domain=domainname&changepw=true&password=randomstr1ng

If we do this just from a browser, everything is logged and works as expected. If we do this from a dashboard that is in a New-UDDynamic it doesn’t work at all.

  1. Second is pretty much the same, but we’re just doing a query against ExchangeOnline. We’re calling: http://url:5463/exchangeonline/getmailboxinfo/user.name@domain.com which again returns everything we want when run just as a straight browser request.

If we do this from another New-UDDynamic it returns a 404 error.

I’m literally going bald from pulling my hair out trying to get this working. We’re transitioning a lot of our calls to endpoints as it seems to be a lot faster, but if I can’t get this resolved or work out what I’m doing so wrong, I may get lynched! :smiley:

Anyone else seen this? I’ve checked everything I know. Endpoints.ps1 is totally normal, and as I’ve said, it works just through a browser.

Any help would be much appreciated!

Cheers,

Daveo

@adam - any idea on this one!? Sorry to tag you specifically but I’m kinda stuck now.

Is the method perhaps different when accessed through New-UDDynamic? Like, in a browser you’re doing a POST, but New-UDDynamic is maybe trying to do a GET. ???

Nope. I’m calling -Method POST

UPDATE! I got it working!

For anyone else that’s having any kind of issue, check your Get-UDElement IDs VERY carefully!!

This was the difference between:

QCR_UsrMbx_txtboxUserMailbox and QCR_UsrMbx_txtboxUsermailbox

Not sure if this is a bug or just my lack of understanding of case-sensitivity, but as soon as I checked everything with a magnifying glass and corrected that bastard “M” it started working as designed!

1 Like

Wow. Good catch. Odd that there’s case sensitivity, though, on something like that.