[URGENT Bug] Library has stopped working. {'errors': [{'code': 'notFound'}]} for profiles that exist
ishan opened this issue · 7 comments
ishan commented
Describe the bug
The library has suddenly stopped working for me.
To Reproduce
- Authenticate
header = account.login(USERNAME, PASSWORD, totp_code)
- Try any operation, like add to denylist, using this header. eg.
denylist.blockdomain(domain, "abcdef", header)
Expected behavior
The domain should be added to the denylist.
Observed behavior
The call fails with code 'notFound'. This happens for all API methods and started happening suddenly in the last 2 days.
hagezi commented
Yes, I can confirm that for me too.
hagezi commented
They seem to have adjusted the API what was configurations before is now profiles and there are other changes.
https://nextdns.github.io/api/#profiles
hagezi commented
The correct code to add a domain to the deny list is now:
import requests
API_KEY = "YOUR_API_CODE" # Find your API key at the bottom of your account page (https://my.nextdns.io/account)
config = "YOUR_CONFIG_ID"
def main():
header = {"X-Api-Key": API_KEY, "Content-Type": "application/json"}
apiurl = f"https://api.nextdns.io/profiles/{config}/denylist"
domain = '{"id": "nextdns-api-test.com"}'
# Add domain to deny list
requests.post(url=apiurl, headers=header, data=domain)
# Print domains from deny list
print(requests.get(headers=header, url=apiurl).json())
if __name__ == "__main__":
main()
rhijjawi commented
Thanks everyone, I'll get to work rewriting the lib ;)
ishan commented
milindpatel63 commented
i am having the same issue again now
rhijjawi commented
Have you updated the library since this issue?