First and foremost, you seem to have posted your API key on the internet, which is basically posting your password. Please change the password associated with that account as it is no longer secure.
As for the error, you are not specifying a specific vsys in the xpath, so that might be the error..? It could also be that if the address group "apadr" is currently a dynamic address group, since you're using a set I know PAN-OS will error out, just don't remember off the top of my head if it's this specific error or something else.
In general, it is highly recommended that you use one of the API libraries Palo Alto Networks has made available for free to make it easier to work with the API, such as pan-python (python), pandevice (python), or pango (golang).
... View more