Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $username = "myemail@yahoo.it"
- $password = "myaccessKey"
- $url = "https://prsrl.od2.vtiger.com/webservice.php?operation=getchallenge&username=" + $username
- $challenge = Invoke-RestMethod $url
- $accessKey = $challenge.result.token + $password
- $md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
- $ascii = new-object -TypeName System.Text.ASCIIEncoding
- $hash = [System.BitConverter]::ToString($md5.ComputeHash($ascii.GetBytes($accessKey)))
- $hash = $hash -replace '-', ''
- $body = @{operation='login'
- username=$username
- accessKey=$hash}
- $url = "https://prsrl.od2.vtiger.com/webservice.php"
- $login = Invoke-RestMethod -Body $body -Method POST -ContentType 'application/x-www-form-urlencoded' $url
- $login
Add Comment
Please, Sign In to add comment