Rest API code to get ID of current user not working: get_current_user_id() gives 0

Rest API code to get ID of current user not working: get_current_user_id() gives 0

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