api
2 TopicsPassing information to API, works in CURL, not in PS7
This API call to a Cisco Firepower 1120 works in CURL (on Ubuntu)... please note credentials and host name have been obfuscated here but are correct in the original versions: curl --cacert fwcert -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "grant_type": "password", "username": "myaccountname", "password": "mypassword" }' 'https://myhost/api/fdm/v5/fdm/token' ...this API returns a temporary token for use in future API requests. It works precisely as expected with a return 200 response and all the fields I need. I am attempting to get this to work in PowerShell 7 (I also tried Powershell ISE v5 before I upgraded), with the following seemingly equivalent code: $param = @{ "grant_type"="password" "username"="myaccountname" "password"="mypassword" } | ConvertTo-Json $fwurl = 'https://myhost/api/fdm/v5/fdm/token' Invoke-RestMethod -Uri $fwurl -Method POST -SkipCertificateCheck -Body $param ... and I get the following error: Invoke-RestMethod: {"message":"Token grant_type is either not-specified or not-supported - null","status_code":400} Since it works in CURL but not Powershell I'm thinking I'm doing something wrong with the PS script but I can't figure out what it is. Help?Solved2.3KViews0likes2CommentsMove Channels between teams via Powershell Graph API
Yes, I asked this in the teams forum then realized thats probably not the place to ask. So I'm asking here IS there a way to do this via the powershell graph (or any other) api? Or do I have to use C# (.net) thanks for your time brad1.3KViews0likes0Comments