How to get post revisions in my custom rest API? [closed]

From just looking at your snippet you’re not actually setting $post_revisions to any value before assigning it to your $post_data array

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