in reply to Solved: Getting an Access Token

I believe your request payload needs to include json encoded user and password info (I have not tried $ua->credentials).

Your $resp object content should show more details of what the server is expecting.
Try dumping it with Data::Dumper or equivalent.

                "These opinions are my own, though for a small fee they be yours too."