I'd start by installing postman - allows you to do api calls from an interactive front end - bit like Dev environment and get the results without writing any wrapper type powershell code around it.
It's what i started with, after also finding the documentation a bit lacking in the example area.
I'm using the Invoke-WebRequest method to get wifi psk and update with new random one on a weekly basis for Guest Wifi.
Powershell scripts takes parameters for site and ssidname with an action switch of Change/Display i've scheduled the script to run once a week on Friday after work and to email the new password to reception ready for guests coming in the following Monday.
It's been running for around a month and seems to work well.
Good luck 🙂