List Api Help pls

CloudFlare api list help

#!/bin/bash

MY_IP=$(curl https://ifconfig.me/ip) # ideally radar.cloudflare.com/ip but dont support

AUTH_KEY="###"
AUTH_EMAIL="###"
API_ACCOUNT_ID="###"
API_LIST_ID="###"
API_ENDPOINT="https://api.cloudflare.com/client/v4/accounts/$API_ACCOUNT_ID/rules/lists/$API_LIST_ID/items"

curl -X POST "$API_ENDPOINT" \
     -H "X-Auth-Email: $AUTH_EMAIL" \
     -H "X-Auth-Key: $AUTH_KEY" \
     -H "Content-Type: application/json" \
     --data '{"items":[{"ip":"'"$MY_IP"'"}]}'
bash list-whitelist-ip.sh
{"success":false,"errors":[{"code":10000,"message":"Authentication error"}]}
Was this page helpful?