Getting "code":10000,"message":"Authentication error" while using api


I was trying to use this script posted here(Block list of ips - #8 by Xaq) to block IPs that are attacking our server via API.

I already entered my Zone id, email, authenkey on the script.

But when i run it, i got these error:
./ badips.txt
{“success”:false,“errors”:[{“code”:10000,“message”:“Authentication error”}]}
curl: (6) Could not resolve host: –data
curl: (3) nested brace in URL position 25:
{“mode”:“block”,“scope”:{“id”:“id”,“name”:“My Organization”,“type”:“organization”},“configuration”:{“target”:“ip”,“value”:“”},“notes”:“Mass Block”}

So what could be the issue here?
I double/ triple check the email and authenkey already.


The syntax of your cURL call is broken. Double check that and if something is unclear clarify it at e.g. StackExchange. That’s a scripting/Bash issue. Your credentials will be all right.

1 Like

I am using CURL like this, where do you think the problem could be?

curl -sSX POST "$zones/firewall/access_rules/rules" \
    -H "X-Auth-Email: $email" \
    -H "X-Auth-Key: $authkey" \
    -H "Content-Type: application/json" \
    –data "{\"mode\":\"block\",\"scope\":{\"id\":\"$id\",\"name\":\"$org_name\",\"type\":\"organization\"},\"configuration\":{\"target\":\"ip\",\"value\":\"$ip\"},\"notes\":\"$notes\"}" ;

I am afraid Bash scripting is beyond the scope of the forum.