Title: Authorize API key
Last modified: March 17, 2021

---

# Authorize API key

 *  [anithajayan](https://wordpress.org/support/users/anithajayan/)
 * (@anithajayan)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/authorize-api-key/)
 * I need to call wordpress endpoints from outside without basic auth. So I used
   api key for that. I defined my api key inside the config file. I am able to get
   main user details by calling the below endpoint.
    [https://mysite.com/wp-json/wp/v2/users/1](https://mysite.com/wp-json/wp/v2/users/1)
   But I am getting a n error while calling for another user as follows [https://mysite.com/wp-json/wp/v2/users/2](https://mysite.com/wp-json/wp/v2/users/2)
   Error: ‘code’: ‘rest_user_cannot_view’, ‘message’: ‘Sorry, you are not allowed
   to list users.’, ‘data’: { ‘status’: 401 } How I can authorize the API key for
   all users? Please help Or please tell any other method for api calls without 
   using username and password

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/authorize-api-key/#post-14197523)
 * API key? Do you mean application password? If so whose application password did
   you use? It needs to be an application password belonging to an admin user. Alternately,
   there are a couple other ways to authenticate API requests. See
    [https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/#authentication-plugins](https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/#authentication-plugins)
 *  Thread Starter [anithajayan](https://wordpress.org/support/users/anithajayan/)
 * (@anithajayan)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/authorize-api-key/#post-14198907)
 * [@bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Thank you for your reply.
 * Yes, How can I authorize the same application password for all the users?
 * I need to retrieve the data using the bearer token without username and password
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/authorize-api-key/#post-14202262)
 * The application password is assigned to the app. App users have no bearing on
   usage. The app uses the same password for all requests regardless of user.
 * It’s possible to get privileged data without authentication through a custom 
   API route/endpoint, but doing so would likely introduce a significant privacy
   and/or security breach. There are good reasons we need authentication to get 
   certain kinds of data.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Authorize API key’ is closed to new replies.

## Tags

 * [api key](https://wordpress.org/support/topic-tag/api-key/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 3 replies
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/authorize-api-key/#post-14202262)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
