API [Aliases] - setItem fails, even with data from getItem

Started by stefandxm, April 04, 2024, 09:18:45 PM

Previous topic - Next topic

#!/usr/bin/env bash

ID_JAILALIAS="e697abeb-0e24-4464-ae88-75d789053a56"

echo "Retrieving old alias" 
curl -s -k -u $FWKEY:$FWSECRET \
        $FWURL/firewall/alias/getItem/$ID_JAILALIAS > tempdata.txt

echo "Posting same old alias"
curl -s -XPOST -k -u $FWKEY:$FWSECRET \
        -H "Content-Type:application/json" \
        $FWURL/firewall/alias/setItem/$ID_JAILALIAS \
        --data-binary @tempdata.txt


Retrieving old alias
Posting same old alias
{"result":"failed","validations":{"alias.proto":"Option not in list.","alias.categories":"Related category not found.","alias.interface":"Option not in list.","alias.type":"Option not in list."}}


Surely this should work?  :-\