I’m getting a 401 while calling the wp-json endpoint via ajax

I had accidentally created a POST rather than a GET. Obviously, you need credentials if you post.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)