Using the API to generate a password
I'm trying to generate a password using the API from PowerShell. However, the following code isn't working for me:
- $pmpServer = "pmpro.mydomain.com:7272"
- $baseUri = "https://$($pmpServer)/restapi/json/v1/passwords/generate"
- $header = @{'AUTHTOKEN'='<tokenCode>'}
- $inputData = @{INPUT_DATA='{ "operation" : { "Details" : { "POLICY" : "Strong"}}}'}
- Invoke-RestMethod -uri $baseUri -Body $inputData -Headers $header -Method Post
When I run the above, I get "404 - File not found error". What am I doing wrong? I don't know the exact PMPro version we're on, but it's pretty recent.
Thanks,
Eric
New to ADSelfService Plus?