php curl follow redirection. Also throws exception
adding an api call to fetch the user details