How to get user id from display name

What do you mean by not working? do you get an error? Are you setting the api version and client id in the header/querystring?