Does anyone have experience with using the Websense API through PowerShell? I need to translate the curl commands (which I have working) into Powershell so they can be scripted. Anyone have any resources that would be useful? Examples of curl commands that I need to translate are below:
Start a new transaction:
curl -k -u <username>:<password> -X POST https://<ps_ip_address>:<port>/api/web/v1/categories/start
Add an API-managed category (all data in the HTTPS request):
curl -k -u <username>:<password> -X POST https://<ps_ip_address>:<port>/api/web/v1/categories -d "{\"Transaction ID\":\"<transaction_ID_string>\",\"Categories\": [ {\"Category Name\": \"<name_string>\",\"Category Description\":\"<description_string>\",\"Parent\": <numeric_category_ID>}]}"
Add a URL (all data in the HTTPS request):
curl -k -u <username>:<password> -X POST https://<ps_ip_address>:<port>/api/web/v1/categories/urls -d "{\"Transaction ID\": \"<transaction_ID_string>\",\"Category ID\": <numeric_ID>,\"URLs\":[\"https://www.new_url.com/\"]}" --cacert PolApiServer.crt
Commit the transaction:
curl -k -u <username>:<password> -X POST https://<ps_ip_address>:<port>/api/web/v1/categories/commit?TransactionID="<id_string>"