The ZAPI version should be 1.X, with the X being dependent on the version of ONTAP you're using. For example, ONTAP 9 = 1.100, 9.1 = 1.110. You'll want to change the NaServer object to look something like this:
s = NaServer(filer, 1, 100)
Try and echo/print out the filer, user, and password variables. Make sure they are equal to what you expect them to be.
Ensure that HTTP access is enabled on your cluster for the interface you're connecting to.
Ensure the user you're using has ONTAPI access granted (though I don't think this is the issue, you would get a different error).
Hope that helps!
If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.