Adding API-managed categories, URLs, and IP addresses

Start a new transaction:

curl -k -u <username>:<password> -X POST https://
<ps_ip_address>:15873/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>:15873/api/web/v1/categories -d 
"{\"Transaction 
ID\":\"<transaction_ID_string>\",\"Categories\": [
{\"Category Name\": \"<name_string>\",\"Category 
Description\":\"<description_string>\",\"Parent\":
<numeric_category_ID>}]}"

Add API-managed categories (data in a JSON file):

curl -k -u <username>:<password> -X POST https://
<ps_ip_address>:15873/api/web/v1/categories -d 
@<filename>.json --header "Content-Type: application/json"

Or:

curl -k -u <username>:<password> -X POST https://
<ps_ip_address>:15873/api/web/v1/categories --upload-file /
<path>/<filename>.json

Add a URL (all data in the HTTPS request):

curl -k -u <username>:<password> -X POST https://
<ps_ip_address>:15873/api/web/v1/categories/urls -d 
"{\"Transaction ID\": \"<transaction_ID_string>\",\"Category 
ID\": <numeric_ID>,\"URLs\":[\"https://www.new_url.com/\"]}"
--cacert PolApiServer.crt

Add URLs or IP addresses (data in a JSON file):

curl -k -u <username>:<password> -X POST https://
<ps_ip_address>:15873/api/web/v1/categories/urls -d 
@<filename>.json --header "Content-Type: application/json"

Or:

curl -k -u <username>:<password> -X POST https://
<ps_ip_address>:15873/api/web/v1/categories/urls --upload- 
file /<path>/<filename>.json

Commit the transaction:

curl -k -u <username>:<password> -X POST https://
<ps_ip_address>:15873/api/web/v1/categories/ 
commit?TransactionID="<id_string>"