cbs803 Posted June 29, 2018 Posted June 29, 2018 Hi, i'm trying to authenticate to REST API but cannot find anything in the forums to match exact scenario - there's a working powershell script but want to utilize autoit instead and i believe could utilize wingethttp to achive this? and once authenticated can send multiple queries thereafter?: working powershell script: $server = "SERVER" $user = "API USER" $pass = "API USER PASSWORD" $pair = "${user}:${pass}" $bytes = [System.Text.Encoding]::ASCII.GetBytes($pair) $base64 = [System.Convert]::ToBase64String($bytes) $basicAuthValue = "Basic $base64" $headers = @{ Authorization = $basicAuthValue } $url = "https://${server}:2616/api/1/oprule/rule/${RuleID}/device/group/${GroupID}?activation=manual" $object = Invoke-RestMethod -Method PUT -Uri $url -Headers $headers $object.assignment.id #Will display the assignment ID Thanks
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now